Program construction task at the end of the course

a) Construct a program, which trasnforms times entered as 
   hours and minutes into minutes. The program terminates when 
   the user enters zero.

   You can presume, that all inputs from user are acceptable. 

Example:

Enter hours and minutes: 3 12
192 minutes
Enter hours and minutes: 0 3
3 minutes
Enter hours and minutes: 1 100
160 minutes
Enter hours and minutes: 1 8
68 minutes
Enter hours and minutes: 0 0
End.

b) Modify the program in such way that at the end the time 
   closest to one hour is displayed. 

   The program must also write out the information if any of the 
   times entered were exactly two hours. 

   You can still presume, that all inputs from user are acceptable. 

Example:

Enter hours and minutes: 3 12
192 minutes
Enter hours and minutes: 0 3
3 minutes
Enter hours and minutes: 1 100
160 minutes
Enter hours and minutes: 1 8
68 minutes
Enter hours and minutes: 0 0
Closest to one hour was 68 minutes.
None of the given times was exactly two hours.