Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5.2: Time Write a program that requests the current time and a waiting time as two integers for the number of hours and the number

image text in transcribed

5.2: Time Write a program that requests the current time and a waiting time as two integers for the number of hours and the number of minutes to wait. The program then outputs what the time will be after the waiting period. Use 24-hour notation for the times. Include a loop that lets the user repeat this calculation for additional input yalues until the user says she or he wants to end the program Input Notes:Both the current time and the waiting time are entered in the form HH:MM where HH and MM are integers signifying hours and minutes respectively, In response to the continuation prompts (described below) the user types a y or a to signify "continue" with any other character signifying "quit Output Notes (Prompts and Labels):At the outset the program prints the title "Compute completion time from current time and waiting period. The program then prompts for the current time with the prompt "Current time:" followed by the instructions "Enter 24 hour time in the format HH:MM. After reading the current time, the waiting time is read in with the prompt "Waiting time:" and the same instructions. The resulting time is printed after the prompt Completion Time in 24 hour format:". This is followed by the continuation prompt "Enter Y or y to continue, any other halts If the resulting time goes into the next day, the additional outout is printed "Completion time is in the day following the start time (see the example below). EXAMPLE: Note that single digit input and outout for both hours and minutes is accepted. Conpute conpletion tine from current time and waiting periad Current time: Enter 24 hour tine in the fornat HH:HM 22:3 Waiting time: Enter 24 hour time in the format HH:MM 85:4 Completion tine is in the day following the start time Completion Tine in 24 hour format: 3:7 Enter Y or y to continue,any other halts Current tine Enter 24 hour tine in the farmat H:DI 9:08 iaiting tine Enter 24 hour tine in the format HH:ND 8:88 Conpletion Time in 24 hour fornot: 17:0 Enter Y or y to continue, any other halts

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions