Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 An employer that is open for business 24 hours per day is interested in the length of its employees' shifts (in hours and

image text in transcribed

Question 3 An employer that is open for business 24 hours per day is interested in the length of its employees' shifts (in hours and minutes). Time-in and time-out are recorded in military time format (e.g., 0900, 1730). Write a Python program to calculate the length of a shift, with the output in hours and minutes. If the first time entered is later than the second time entered you should assume that the second time refers to the following day. Call your program shift_time.py. Sample input/output 1: Please enter the start time: 0900 Please enter the end time: 1730 The length of the shift is 8 hours 30 minutes. Sample input/output 2: Please enter the start time: 2230 Please enter the end time: 0800 The length of the shift is 9 hours 30 minutes. Test your program with the following data, including switching the order of each pair of times - 09000900 - 12001201 - 22002400 - 04302200

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions