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 values 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 Y  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 output is printed "Completion time is in the day following the start time" (see the example below). EXAMPLE: Note that single digit input and output for both hours and minutes is accepted. Compute completion time from current time and waiting period Current time: Enter 24 hour time in the format HH:MM 22:3 Waiting time: Enter 24 hour time in the format HH:MM 05:4 Completion time is in the day following the start time Completion Time in 24 hour format: 3:7 Enter Y or y to continue, any other halts y Current time: Enter 24 hour time in the format HH:MM 9:00 Waiting time: Enter 24 hour time in the format HH:MM 8:00 Completion Time in 24 hour format: 17:0 Enter Y or y to continue, any other halts

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
icon
Concept explainers
Question

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 values 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 Y  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 output is printed "Completion time is in the day following the start time" (see the example below).

EXAMPLE: Note that single digit input and output for both hours and minutes is accepted. Compute completion time from current time and waiting period
Current time:
Enter 24 hour time in the format HH:MM
22:3
Waiting time:
Enter 24 hour time in the format HH:MM
05:4
Completion time is in the day following the start time
Completion Time in 24 hour format:
3:7


Enter Y or y to continue, any other halts

y
Current time:
Enter 24 hour time in the format HH:MM
9:00
Waiting time:
Enter 24 hour time in the format HH:MM
8:00
Completion Time in 24 hour format:
17:0


Enter Y or y to continue, any other halts

!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY