Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 023). The following pseudocode describes an algorithm that determines whether the appointment with start time start1 and end time end1 overlaps with the appointment with start time start2 and end time end2 in python code.
If start1> start2
s = start1
Else
s = start2
If end1< end2
e = end1
Else
e = end2
If s < e
The appointments overlap.
Else
The appointments dont overlap.
Here is a sample run
Please enter the first appointment start time: 10
Please enter the first appointment end time: 12
Please enter the second appointment start time: 11
Please enter the second appointment end time: 13
The appointments overlap
Please enter the first appointment start time: 10
Please enter the first appointment end time: 11
Please enter the second appointment start time: 12
Please enter the second appointment end time: 13
The appointments dont overlap
Please enter the first appointment start time: 70
Please enter the first appointment end time: 12
Please enter the second appointment start time: 11
Please enter the second appointment end time: 13
Invalid time(s)

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

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

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

ISBN: 1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

8. Describe the steps in the development planning process.

Answered: 1 week ago