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; }

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section: Chapter Questions
Problem 6PP: (Heat transfer) The formula developed in Exercise 5 can be used to determine the cooling time, t,...
icon
Related questions
Question

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;

}

 

 

 

Enter the elapsed time in total second: 9630
The total time is 2 : 40 30
Transcribed Image Text:Enter the elapsed time in total second: 9630 The total time is 2 : 40 30
Enter the elapsed time in total second: 3665
The total time is 1 : 1:5
Transcribed Image Text:Enter the elapsed time in total second: 3665 The total time is 1 : 1:5
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr