Question: Write a program that reads two times in military format (example: 0900 and 1730) and prints the number of hours and minutes between the two

 Write a program that reads two times in military format (example:

Write a program that reads two times in military format (example: 0900 and 1730) and prints the number of hours and minutes between the two times. Then, it will display the result as shown below. Note that the first 2 digits are from 00 to 23 (they represent the hours) and the last two digits are from 00 to 59 (they represent the minutes). Hint: Convert both times to minutes then subtract and convert back to hours and minutes. Sample run 1: Enter time 1: 0905 Enter time 2: 1245 Difference between the 2 times is 3 hours and 40 minutes Sample run 2: Enter time 1: 1055 Enter time 2: 1305 Difference between the 2 times is 2 hours and 10 minutes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!