Carefully read the main() function below and then write the following three functions: Name: timeInput Job: function will readthe total elapsed time for an event in seconds from user and return it to the main. Name: HourMinuteSecondTime Parameters: total elapsed time in seconds. Job: The function will convert and return elapsed time to hours, minutes, and seconds using three reference parameters. (For example, if the elapsed time is 9630 seconds, then the function will return 2, 40, 30). Name: timeOutput Parameters: time in hours, minutes, and seconds. Job: The function will properly display the time in hours : minutes : second form. int main() { int h, m, s, ts; ts = timeInput(), HourMinuteSecondTime(ts, h,m,s); timeOutput(h,m,s); return 0; }
Carefully read the main() function below and then write the following three functions:
Name: timeInput
Job: function will readthe total elapsed time for an event in seconds from user and return it to the main.
Name: HourMinuteSecondTime
Parameters: total elapsed time in seconds.
Job: The function will convert and return elapsed time to hours, minutes, and seconds using three reference parameters. (For example, if the elapsed time is 9630 seconds, then the function will return 2, 40, 30).
Name: timeOutput
Parameters: time in hours, minutes, and seconds.
Job: The function will properly display the time in hours : minutes : second form.
int main()
{
int h, m, s, ts;
ts = timeInput(),
HourMinuteSecondTime(ts, h,m,s);
timeOutput(h,m,s);
return 0;
}
Step by step
Solved in 4 steps with 2 images