You are given an input representing the current military time in hours and minutes. You are also given two additional values, h and m. These are the hours and minutes that pass. Display the new current time. Input Format First line is a String value representing the current time. Second line is the number of elapsed hours. Third line is the number of elapsed minutes. Constraints The String representing the current time will always be 5 characters in length. The first two characters will be a value anywhere from 00 to 23 (midnight to 11pm). The third character will be a ':'. The last two characters will be a value anywhere from 00 to 59 (number of minutes of the hour). The elapsed hours value will be from 0 to 2 billion. The elapsed minutes value will be from 0 to 2 billion. Output Format Display a 5 character String representing the current military time after the elapsed hours and minutes have passed. Sample Input 0 08:30 2 15 Sample Output 0 10:45 Explanation 0 The starting time is 8:30am. in 2 hours and 15 minutes it will be 10:45am Sample Input 1 11:22 1 50 Sample Output 1 13:02 Explanation 1 It is 11:22. (Remember military time is from 0 to 23) in 1 hour and 50 minutes it will be 1:02pm which is 13:02 in military time

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

You are given an input representing the current military time in hours and minutes. You are also given two additional values, h and m. These are the hours and minutes that pass. Display the new current time.

Input Format

First line is a String value representing the current time.
Second line is the number of elapsed hours.
Third line is the number of elapsed minutes.

Constraints

The String representing the current time will always be 5 characters in length. The first two characters will be a value anywhere from 00 to 23 (midnight to 11pm). The third character will be a ':'. The last two characters will be a value anywhere from 00 to 59 (number of minutes of the hour).
The elapsed hours value will be from 0 to 2 billion. The elapsed minutes value will be from 0 to 2 billion.

Output Format

Display a 5 character String representing the current military time after the elapsed hours and minutes have passed.

Sample Input 0

08:30 2 15

Sample Output 0

10:45

Explanation 0

The starting time is 8:30am.
in 2 hours and 15 minutes it will be 10:45am

Sample Input 1

11:22 1 50

Sample Output 1

13:02

Explanation 1

It is 11:22. (Remember military time is from 0 to 23)
in 1 hour and 50 minutes it will be 1:02pm which is 13:02 in military time  

Expert Solution
steps

Step by step

Solved in 3 steps with 2 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-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education