Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Respond to personality differences among people.

Answered: 1 week ago

Question

Show the properties and structure of allotropes of carbon.

Answered: 1 week ago

Question

Which form of proof do you find least persuasive? Why?

Answered: 1 week ago