Computers and Technology

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!

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, razielcornils04
What is the algorithm for building a binary tree program
Answers: 2
image
Computers and Technology, 23.06.2019 19:00, amayax77
Write a program that displays the following menu: geometry calculator 1. calculate the area of a circle 2. calculate the area of a rectangle 3. calculate the area of a triangle 4. quit enter your choice (1-4): if the user enters 1, the program should ask for the radius of the circle and then display its area. use the following formula: area = ď€(the square of r) use 3.14159 for ď€ and the radius of the circle for r. if the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. use the following formula: area = length * width if the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. use the following formula: area = base * height * .5 if the user enters 4, the program should end. input validation: display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. note: if the user enters an improper menu choice (1-4), the program prints "the valid choices are 1 through 4. run the program again and select one of those." if the user enters a negative radius, the program prints "the radius can not be less than zero." if the user enters a negative value for height or base, the program prints "only enter positive values for base and height."
Answers: 1
image
Computers and Technology, 24.06.2019 07:30, Isabellawuzhere
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
image
Computers and Technology, 24.06.2019 12:50, neptunesx
Write a new lc-3 trap subroutine (i. e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i. e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e. g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e. g. b0000 0000 0000 0111 =
Answers: 3
Do you know the correct answer?
Description Military time uses 24 hours for the entire day instead of 12 for am/pm separately. Mili...

Questions in other subjects:

Konu
Mathematics, 14.04.2021 02:20
Konu
Mathematics, 14.04.2021 02:20
Konu
Mathematics, 14.04.2021 02:20