Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Can I have help with this? In Dr Java please. image text in transcribed
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

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

More Books

Students also viewed these Databases questions

Question

Acceptance of the key role of people in this process of adaptation.

Answered: 1 week ago

Question

preference for well defined job functions;

Answered: 1 week ago