Question: Write a C++ function named time() that has an integer parameter named seconds and three integer reference parameters named hours, mins, and secs. The function

Write a C++ function named time() that has an integer parameter named seconds and three integer reference parameters named hours, mins, and secs. The function is to convert the passed number of seconds into an equivalent number of hours, minutes, and seconds. Using the reference parameters, the function should alter the arguments in the calling function.

** The solution is wrong in the textbook solutions section. ** Here is what I have done, just need some help debugging and tweaking:

Write a C++ function named time() that has an integer parameter named

10 include kiostream 11 I include kiomanip #include kcmath 12 using namespace std; 13 14 15 I void time (int, int&, int&, int&); 16 17 int main 18 int seconds, hours, minutes secs; 19 20 cout "Please enter the time in seconds to be converted 21 Cin secs; 22 23 time (seconds, &hours, &minutes, &secs); 24 cout "Hours hours endl 25 cout "Minutes minutes endl 26 cout Remaining Seconds secs endl; 27 28 system ("pause"); 29 30 31 return 0 32 33 34 35 void time (int secnds, int hours int &m int &secs) inutes 36 int total 37 38 total secnds 3600 Original Seconds Total 39 hours secnds 3600 Equivalent Hours Calculation minutes total 60 Equivalent Minutes Calculation 41 secs total 60) Equivalent Seconds Calculation 42 43 44 45

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 Databases Questions!