Question: In a scheduling program, we want to check whether two appointments overlap. For simplicity, appointments start at a full hour, and we use military time
In a scheduling program, we want to check whether two appointments overlap. For simplicity, appointments start at a full hour, and we use military time with hours The following pseudocode describes an algorithm that determines whether the appointment with start time start and end time end overlaps with the appointment with start time start and end time end in python code.
If start start
s start
Else
s start
If end end
e end
Else
e end
If s e
The appointments overlap.
Else
The appointments dont overlap.
Here is a sample run
Please enter the first appointment start time:
Please enter the first appointment end time:
Please enter the second appointment start time:
Please enter the second appointment end time:
The appointments overlap
Please enter the first appointment start time:
Please enter the first appointment end time:
Please enter the second appointment start time:
Please enter the second appointment end time:
The appointments dont overlap
Please enter the first appointment start time:
Please enter the first appointment end time:
Please enter the second appointment start time:
Please enter the second appointment end time:
Invalid times
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
