Question: Chapter 1 1 Arrival Time Estimator Create a program that calculates the estimated duration of a trip in hours and minutes. This should include an
Chapter Arrival Time Estimator
Create a program that calculates the estimated duration of a trip in hours and minutes. This should include an estimated datetime of departure and an estimated datetime of arrival. Display the output with the format shown below.
Console
Arrival Time Estimator
Enter date of departure YYYYMMDD:
Enter time of departure HH:MM AMPM: : PM
Enter miles:
Enter miles per hour:
Estimated travel time
Hours:
Minutes:
Estimated date of arrival:
Estimated time of arrival: : AM
Continue? textrmytextrmn:textrmy
Enter date of departure YYYYMMDD:
Enter time of departure HH:MM AMPM: : MM
Enter miles:
Enter miles per hour:
Estimated travel time
Hours:
Minutes:
Estimated date of arrival:
Estimated time of arrival: : PM
Continue? yn: n
Bye!
Specifications
For the datetime of departure and arrival, the program should use the YYYYMM DD format for dates and the HH:MM AMPM format for times.
Create a single datatime string variable based on the two input variables. Use this combined string variable to create a departure datetime object that will be used to determine the estimated arrival date and time.
For the miles and miles per hour, the program should only accept integer entries, such as for miles or for mph
Calculate the hours travelled based on the integer division of miles divided by mph The minutes are based on the remainder of miles divided by mph The remainder must then be converted to minutes based on the mph Use the hours and minutes to create a time delta object.
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
