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

1. 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. 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. 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;