Question: Write a program that will ask the user for 1 ) the current time, 2 ) the current day of the week, and 3 )

Write a program that will ask the user for 1) the current time, 2) the current day of the week, and 3) how long the timer should be, and display the time and day of the week when the timer ends.
Specifically, your program should do the following:
Ask the user for the current time:
Assume the user enters the time in the 12-hour format: "hh:mmam" or "hh:mmpm"
Examples: 08:00am,09:30pm,11:35pm
Your program should keep asking if the time the user enters is invalid.
The valid times are from 00:00am till 11:59pm, or 01:00am till 12:59am the next day. You can do it either way.
Ask the user for the day of the week:
If the user enters anything other than Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, your program should ask again until they enter a valid value.
Ask the user for the length of the timer in the format of "hh:mm"
"hh": is the number of hours of the timer
"mm": is the number of minutes of the timer
For simplicity, we longest timer we allow will be 23 hours 59 minutes.
Ask the user for the timer length again if the timer length is out of the range
Calculate and print the time and day of week when the timer ends and print the result time in 12hour format nicely.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!