Question: Can I have help with this? In Dr Java please. Lab 03 A Later Time Objective: Create a program which prompts the user to enter
Lab 03 A Later Time Objective: Create a program which prompts the user to enter a time in "Hour:Minute" format and then prompts the user to enter a value, in minutes, that wll add to that time. Once the calculation is completed output the resulting time . This is assumed to be in military time, so make sure that there is only 24 hours (0-23), 60 minutes (0-59) in any given time . Take a variety of inputs as long as it is in the format "Hour:Minute o 06:02 and 6:2 are both valid inputs . Output the original time along with the new time Example Dialog: Enter a time in the format hour minute 3:30 Enter a number of minutes to add to this time 50 The time 50 minutes after 3:30 will be 4:20 Hint: Here is an algorithm to solve this problem 1. Read the time. 2. Make a copy of the date. 3. Find the index of the :". 4. Copy the hour part out of the time to a new variable. s. Parse the hour string into a number 6. Next save the minutes into a different variable . Parse the minutes s. Add the new minutes to the recently parsed minutes 9. Adjust the number of minutes to only be 0-59 and add the number of hours, if needed to the hours. Also adjust the hours to be 0-23 if needed. 10. Print the results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
