Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started