Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Project: Flight program The following table shows the daily flights from one city to another: Departure time Arrival time 8:00 am 10:16 am 9:43

Programming Project: Flight program The following table shows the daily flights from one city to another: Departure time Arrival time 8:00 am 10:16 am 9:43 am 11:52 am 11:19 am 1:31 pm 12:47 pm 3:00 pm 2:00 pm 4:08 pm 3:45 pm 5:55 pm 7:00 pm 9:20 pm 9:45 pm 11:58 pm Write a program that displays the above menu of flight times, then asks the user to enter a time (expressed in hours and minutes, using the 24 hour clock). The program then displays the departure and arrival times for the flight whose departure time is closest to that entered by the user. Sample Output: Enter a 24-hour time: 13:15 The closest departure time is 12:47 pm, arriving at 3:00 pm. Hint: Convert the input into a time expressed in minutes since midnight, and compare it to the departure times, also expressed in minutes since midnight. For example, 13:15 is 13 x 60 + 15 = 795 minutes since midnight, which is closer to 12:47 pm (767 minutes since midnight) than to any of the other departure times. Make sure you include comments throughout your code! You do not have to check for invalid data. A digit will be entered upon request, and no illegal data entries need to be checked for on this project. Perform the steps taught in the Lab reports on how to write a program and how to document the program. Define the problem and include an algorithm.

Can someone please post a simple if else statement program in PYTHON for the description above that can be successfully ran?

subject:CSCI180

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

What are the main differences between rigid and flexible pavements?

Answered: 1 week ago

Question

What is the purpose of a retaining wall, and how is it designed?

Answered: 1 week ago

Question

How do you determine the load-bearing capacity of a soil?

Answered: 1 week ago

Question

what is Edward Lemieux effect / Anomeric effect ?

Answered: 1 week ago

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago