Question: Write a simple and very basic C + + program ( using array ) : Exercise# 3 : Time Carefully read the main ( )

Write a simple and very basic C++ program (using array):
Exercise#3: Time
Carefully read the main() function below and then write the following three functions:
Name: timelnput
Job: function will read the total elapsed time for an event in seconds from user and return it to the
main.
Name: HourMinuteSecondTime
a. Parameters: total elapsed time in seconds.
b. 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
c. Parameters: time in hours, minutes, and seconds.
d. 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;
}
Sample input / output:
Enter the elapsed time in total second: 9630
The total time is 02:40:30
Enter the elapsed time in total second: 3665
The total time is 01:01: 05
Write a simple and very basic C + + program (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!