Due by Sunday, September 23, midnight
If you turn it in after midnight but before 9:00 am the next day, you will lose half credit. After 9:00 am, you lose all the points. Use the Canvas link to submit your program.
Educational goals of this lab - verify that every student can
There are many programs which work with clock time, like payroll programs and calendar programs. Many times two times, expressed as hours, minutes and seconds, need to be compared to determine which one comes first. You can assume for this program that the two times are in the same DAY, and a 24-hour clock is used, so the times range from 0:00:00 to 23:59:59.
There are 3 possible results of comparing two times, Time1 is earlier than Time2, Time1 is later than Time2 or the times are the same.
1. Do NOT convert the times into total seconds - that makes the logic too easy! compare the times piece by piece, hours, then minutes then seconds.
2. Make SURE you are comparing integers and not strings! If you compare strings like "9" and "23" you will be surprised at the result!
Put the answers to the test plan as a comment at the bottom of your .py file. It should be the expected output from the above problem, given the inputs in the case.
|Time1 earlier than Time2, b/c seconds||5,10,20||5,10,45||Time1 is earlier than Time2|
|Time1 earlier than Time2, b/c hours||15,10,10||17,23,15||____A.____|
|Time1 earlier than Time2, b/c minutes||5,0,20||5,10,5||____B.____|
|Times the same||7,5,20||7,5,20||____C.____|
|Time1 later than Time2, b/c seconds||9,35,45||9,35,25||____D.____|
|Time1 later than Time2, b/c minutes||6,25,45||6,15,55||____E.____|
(20 points) Individual problem #2: Designing the program
(30 points) Individual problem #3: Writing the program
Enter Time1 hours: 12 Enter Time1 minutes: 33 Enter Time1 seconds: 15 Enter Time2 hours: 14 Enter Time2 minutes: 21 Enter Time2 seconds: 12 Time 1: 12:33:15 Time 2: 14:21:12 Time1 is earlier than Time2
Enter Time1 hours: 1 Enter Time1 minutes: 1 Enter Time1 seconds: 1 Enter Time2 hours: 3 Enter Time2 minutes: 4 Enter Time2 seconds: 5 Time 1: 1:01:01 Time 2: 3:04:05 Time1 is earlier than Time2
Enter Time1 hours: 10 Enter Time1 minutes: 15 Enter Time1 seconds: 9 Enter Time2 hours: 3 Enter Time2 minutes: 45 Enter Time2 seconds: 7 Time 1: 10:15:09 Time 2: 3:45:07 Time1 is later than Time2
Log off properly - you don't want your account misused by someone else!
Remember not to leave files on the local hard drives in this lab or anywhere else on campus! Make sure you save your projects on a portable storage device you take with you!