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
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
I need output for the sample input 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started