Write an algorithm (without modules) that asks the user to input the elapsed time for an event in seconds. The algorithm then outputs the elapsed time in hours, minutes and seconds.
(For example, if the elapsed time is 9630, then the output is 2:40:30)
2. Rewrite the previous algorithm with three modules in addition to the Control module.
3. Translate the algorithm created in part 1 into a C++ program without functions.
4. Translate the algorithm created in part 2 into a C++ program with functions.
Tip: Start a new C++ project, add the main entry point and code what you need to code. Don't know what goes into the main entry point? Well, then ask. But show the main entry point as you have it.
i need now to write it wt fuctions .. but how ?? any tips ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main ()
{
int time_sec;
cout<<"Enter the time in seconds to otput the time in hours, minutes and seconds: \n";
cin>>time_sec;
cout<<"Here it is in Hours, Minutes, Secounds:\n"<<(time_sec/3600)<<":"<<(time_sec%3600)/60<<":"<<((time_sec%3600)%60);
return 0;
}
#include <iostream>
usingnamespace std;
int Read ();
int Calc_time_sec(int);
int Print (int);
int main (){
int time_sec;
time_sec = Read();
intvoid Print ()
}
cout<<"Enter the time in seconds: \n";
cin>>time_sec;
cout<<"Here it is in Hours, Minutes, Secounds:\n"<<(time_sec/3600)<<":"<<(time_sec%3600)/60<<":"<<((time_sec%3600)%60);
return 0;