Ask Question

Now write a program to convert minutes to time (separate hours/minutes). Include a user-defined void function named minutesToTime that takes an integer number of minutes and converts it to two separate integer values that represent the equivalent number of hours and minutes. You must use reference parameters for the hours and minutes. Before proceeding further, discuss with a neighbor or TA why this function uses reference parameters.

+5
Answers (1)
  1. 3 August, 11:26
    0
    See explaination

    Explanation:

    #include

    #include

    using namespace std;

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

    {

    hours=minute_value/60;

    mins=minute_value%60;

    }

    int main ()

    {

    int minute_value, hours, mins;

    char choice='y';

    while (choice!='n')

    {

    cout<<"Enter a number of minutes: ";

    cin>>minute_value;

    minutesToTime (minute_value, hours, mins);

    cout<<"Hours:minutes is "<
    cout <
    cout<<"/nContinue? (y/n) : ";

    cin>>choice;

    }

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Now write a program to convert minutes to time (separate hours/minutes). Include a user-defined void function named minutesToTime that ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers