Question: Programming challenge description: Write a program that, given two clock times, prints out the absolute number of minutes between them. Input: Your program should read

Programming challenge description:

Write a program that, given two clock times, prints out the absolute number of minutes between them.

Input:

Your program should read lines from standard input. Each line contains two wall clock times separated by a hyphen. Wall clock time is defined as hh:mm followed by AM' or 'PM', e.g. '09:05 AM'

Output:

Print to standard output the number of minutes between the two times from standard input. Print out each result on a new line.

Test 1

Test Input

10:00 AM - 11:00 AM

Expected Output

60

Test 2

Test Input

1:00 PM - 11:00 AM

Expected Output

1320

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!