Given the following program:
// Program to convert hours, minutes, seconds into seconds.
. . . // initial program statements omitted.
//----------------------------------------------------- main
int main() {
int hours, minutes, seconds;
while (readRange(hours , 0, 1000)
&& readRange(minutes, 0, 59)
&& readRange(seconds, 0, 59)) {
cout << hours << ":" << minutes << ":"<< seconds << endl;
}
return 0;
}//end main
//----------------------------------------------------- readRange
int readRange(int& x, int low, int high) {
while (1) {// repeat until break or return;
cout << "Enter an integer in the range "
<< low << " to " << high << endl;
if (cin >> x) {
if (x < low || x > high) {
cout << x << " is out of range." << endl;
}else{
break; //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
}
}else{
return 0; //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
}
}//endwhile
return 1;
}//end readRange
- (2 points) What is the output from the main function (for this question
ignore the output from the readRange function) when the following numbers are entered:
3 5 10
- (2 points) What is the output (again, only from the main function)
when the following numbers are entered by the user:
5 66 7 88 9 10