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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started