#include <iostream>
using namespace std;
void OutputMinutesAsHours(double origMinutes) {
double hours = origMinutes / 60.0;
cout << hours;
}
int main() {
OutputMinutesAsHours(210.0); // This function will also be called with 3600.0 and 0.0.
cout << endl;
return 0;
}
The lines highlighted in bold perform the conversion from minutes to hours by dividing the input minutes by 60, since there are 60 minutes in one hour. The parameter origMinutes is a double, so the division uses 60.0 to keep consistent data types. Running this code with 210.0 will output 3.5.