Ask Question
23 December, 09:09

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.

+4
Answers (1)
  1. 23 December, 09:47
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers