subject

Description Military time uses 24 hours for the entire day instead of 12 for am/pm separately. Military time is a 4 digit (base-10) integer with the following rules:
The first two digits show the hour (between 00 and 23) and
The last two digits show the minutes (between 00 and 59)
There is no colon separating hours from minutes.
Military time starts at 0000 in the morning and counts up
When we get to the afternoon, we use 1300 for 1:00 PM and 2300 for 11:00 PM.
When we get to midnight, the hour is 00 (not 24).
TASK: Write a program that reads two times in military format and prints the number of hours and minutes between the two times (See example below).
NOTE: Your program should consider the difference between the times IN THE SAME DAY. For example: The time difference between 2359 and 0000 is 23 hours and 1 minute (NOT 1 minute).
Detailed Requirements
• Compose a written document (MS Word Document) describing your algorithm, feel free include a diagram if you like
• The program should prompt for two times separately, then print the duration of time between (see sample output below).
• The program should check the input for the correct military time format:
. Make sure the hours are between 00 and 23.
. Make sure the minutes are between 00 and 59
. If the validity check fails, it should print an appropriate error and prompt again.
• Your program should use io manipulators to produce military time with leading zeroes. e. g. 9 am should be printed 0900 (not 900).
• More points will be awarded to an implementation that can produce an accurate result regardless of the order of the inputs.
• Do not produce runtime errors that abruptly end your program (crash)
• Include descriptive comments, neat indentation, proper spacing for good readability, and appropriate and consistently named variables.
• Program source should have a comment block at the top with the student name, section, and description of your program.
Please enter a time: 1sykdf
Military Tine Format Required: Bad input, try again.
Please enter a time: 2580
Military Tine Format Required: Hours must be between 2 and 23, try again
Please enter a time: 2365
Military Tine Format Required: Minutes must be between me and 59, try again
Please enter a time: 0900 First time 0900 accepted.
Please enter a time: jdkjs
Military Time Forest Required: Bad input, try again.
Please enter a time: 39573
Military Tine Format Required: Hours must be between 28 and 23, try again
Please enter a time: 1799
Military Tine Format Required: Minutes must be between me and 59, try again
Please enter a time: 1730 Second time: 1738 accepted.
Time difference between 1988 and 1732 ts 8 hours and 30 minutes Dismissed solder!
Note! When I change the order of the time inputs. I get the same result!

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Draw the hierarchy chart and design the logic for a program that calculates service charges for hazel's housecleaning service. the program contains housekeeping, detail loop, and end-of-job modules. the main program declares any needed global variables and constants and calls the other modules. the housekeeping module displays a prompt for and accepts a customer's last name. while the user does not enter for the name, the detail loop accepts the number of bathrooms and the number of other rooms to be cleaned. the service charge is computed as $40 plus $15 for each bathroom and $10 for each of the other rooms. the detail loop also displays the service charge and then prompts the user for the next customer's name. the end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete.
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Which of the following factors would your hypothetical supervisor look at when deciding whether to test a biological material sample for dna? the amount of other evidence you have implicating a suspect in a crime the annual budget for the crime lab both of the above none of the above; you would almost always order a test
Answers: 3
question
Computers and Technology, 24.06.2019 15:30
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
One important thing in finding employment is to get your resume noticed and read.true or false
Answers: 2
You know the right answer?
Description Military time uses 24 hours for the entire day instead of 12 for am/pm separately. Mili...
Questions
question
Mathematics, 04.03.2021 18:50
question
Social Studies, 04.03.2021 18:50
question
Mathematics, 04.03.2021 18:50
question
Mathematics, 04.03.2021 18:50
question
History, 04.03.2021 18:50
question
English, 04.03.2021 18:50
Questions on the website: 13722361