write my assignment 13109

Write program to convert minutes to time (separate hours/minutes). Include a user-defined void function named ‘ minutesToTime ‘ that will take an integer number of minutes and convert it to two separate integer values that represent the equivalent number of hours and minutes. Your must use reference parameters for the hours and minutes.

void minutesToTime (int minute_value, int& hours, int& mins)

Your main program should do the following:

  • prompt the user and take as input an integer number of minutes from the console.
  • call minutesToTime to compute the equivalent number of hours and minutes.
  • display the result on the terminal display using a ‘colon’ character to separate the hours/minutes. Moreover, if the number of minutes is less than 10, print it out with a leading zero (so, e.g. 8 minutes would be printed as 08 rather than 8).
  • Include a loop that will continue this process as long as the user wishes.

Example:

Enter a number of minutes: 60

Hours:minutes is 1:00

Continue? (y/n): y

Enter a number of minutes: 8

Hours:minutes is 0:08

Continue? (y/n): y

Enter a number of minutes: 337

Hours:minutes is 5:37

Continue? (y/n): n

 
"Not answered?"
Get the Answer