For example. The starting miles could be 100130.5 and the ending miles could be 101045.9. Also
the hours could be 16.25 (16 hours and .25 hours (15 minutes)). The miles per hour in this case
would be 56.3.
1)What impact does this have on your selection of the data type you should use for
your application?
2)Look at the above description. How many prompts for input values should your program have?
3)How many variables do you need to read in from the console? What type of data will they hold?
4)How many variables do you need for calculations and results? Again what type of data will they
is question 2 3 input values and question 3 4 variables?
thanks
// Example program
#include <iostream>
#include <string>
struct Time{
int hour;
int min;
};
usingnamespace std;
int main()
{
Time t;
float starting_point;
float ending_point;
float result;
cout<<"Enter time ( hour min ) : ";
cin>>t.hour>>t.min;
cout<<"Enter Starting point : ";
cin>>starting_point;
cout<<"Enter Ending point : ";
cin>>ending_point;
// result = your calculations.
cout<<result;
return 0;
}