#include <iostream>
using namespace std;
int main()
{
double distance = 783.67;
double aver_speed = 60;
double elaps_time = distance / aver_speed;
int el_time_in_sec = elaps_time * 3600;
int hour = elaps_time;
int sec = (elaps_time - hour) * 3600;
int min = sec / 60;
sec = sec - min * 60;
cout << "Elapsed time, that takes to make 783.67-mile trip is\n"
<< elaps_time << " hours or\n" << el_time_in_sec << " seconds or \n"
<< hour << " hours " << min << " minutes " << sec << " seconds ";
}
Comments
Leave a comment