Thread: I need help with mathematical coding.......911

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    5

    I need help with mathematical coding.......911

    Hello fellow programmers

    Hello it is Semma. I have an assignment where i have incoporate an integer for meters. Where the user has to answer this question:

    (Ex.A) What are the dimenson of your yard in meters ? 50 75

    (Ex.B) What are the dimensions of your house in meters ? 33 25

    This is what I have written :

    (ex.A)

    / / Questions(?)

    cout<<"what are the dimensions of your yard in meteres..(?)";<<endl;
    cin >>YardMeters;
    cout <<"Yard in meters:"<<YardMeters;<<endl;
    cout <<"What are the dimensions of your house in meters..(?)";
    cin >>HouseMeters;
    cout <<"House in meters:"<<HouseMeters;<<endl;

    (ex.B)

    // Meter Calculation Integer
    int YardMeters;
    int HouseMeters;
    (ex.C)

    // Calculating Dimensions
    int Calculation_A;
    int Calculation_B;
    int Rounding_B;
    int ConversionHours;
    int ConversionSecond;
    int ConversionMinute;

    Then i have to convert yard in meters and house in meters to at a

    rate of 2 square meters per second it will take you 1462.5

    seconds. Then i have to round it to the nearest second. After it

    will display 1463 seconds which converts to 0 hour(s) 24minutes

    and 23 seconds(s).

    Therefore what code can I use to make these conversions of, the

    rate of 2 square meters per second and rounding it to the

    nearest second.

    Thank you..........

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    156
    I'm more than willing to help. But I'd like to see you make an attempt to layout the logic not just the ouput statements. When its done you will have learned a great deal more.... Enough from the pulpit.

  3. #3
    Registered User kitten's Avatar
    Join Date
    Aug 2001
    Posts
    109
    cout<<"what are the dimensions of your yard in meteres..(?)";<<endl;
    cout <<"Yard in meters:"<<YardMeters;<<endl;
    cout <<"House in meters:"<<HouseMeters;<<endl;

    Too much of semicolons here. This is correct:

    cout<<"what are the dimensions of your yard in meteres..(?)"<<endl;
    cout <<"Yard in meters:"<<YardMeters<<endl;
    cout <<"House in meters:"<<HouseMeters<<endl;
    Making error is human, but for messing things thoroughly it takes a computer

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 03-20-2009, 05:22 PM
  2. Coding Guideline ....!!
    By imfeelingfortun in forum Tech Board
    Replies: 8
    Last Post: 10-08-2006, 07:09 AM
  3. Before Coding
    By cyberCLoWn in forum C++ Programming
    Replies: 16
    Last Post: 12-15-2003, 02:26 AM
  4. Coding Contest....
    By Koshare in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 10-14-2001, 04:32 PM