Program #4 • Write a program that calculates the elapsed time in minutes between a start time and an end time. • The times will be expressed as integers on a 24-hour clock (use military time). • Include two functions: O A function that returns a Boolean value of true if the ending time is greater than the beginning time and a value of false if the ending time is less than the beginning time. . Use this function to error check the input. Send the function two inputs through the parameter list as byValue: the beginning time and the ending time. • The function will return a true or a false through the function name. • Return a true if the beginning time is less than the ending time. • Return a false if the ending time is less than the beginning time. . If the function returns a true to main then calculate the elapsed time. . If the function returns a false then print out an error message stating that the beginning time must be less than the ending time. • A function that calculates the elapsed time in minutes only between a start time and an end time. • The times will be expressed as integers on a 24-hour clock (use military time). This function must convert them and compute the lapsed time. • The function will take two inputs as byValue in the parameter list: the start time and the end time. The function will return the elapsed time through the function name. - The elapsed time will be in minutes. For example, if the beginning time is 330 (3:30 am) and the ending time is 1900 (7:00 pm) then the elapsed time is 930 minutes. • Be sure to include the prologue information. • Be sure to include the initial and refined algorithms for the main function. • To express the time in military: o Only use times on the hour or half hour. o You need to only deal with end times occurring later on the same day as the start time. For example, the ending time must be greater than the beginning time. o Examples of how times will be represented are as follows: • Midnight will be represented as 0. • 1:00 am will be represented as 100. • 10:00 am will be represented as 1000. 12 noon will be represented as 1200. • 3:30 pm will be represented as 1530. • Have the User enter the time without a colon. For example, 8:30 pm will be entered as 2030. • Use a While loop to allow the User to run the program more than once. Use a sentinel value of "Y" and prompt the User to enter a "Y" if they wish to continue. • HINT: It's easy to figure out the number of minutes when both the ending and beginning times are on the hour like 7:00 pm. It gets tricky when you have a time on the half hour like 3:30 am. You will need to strip away the 30 minutes from 3:30 am first. • Remember that the difference between the times must be computed in minutes. So if the user enters 330 and 1900, you first compute the number of hours (which is 15 hours) and multiply this by 60 for total minutes. You then add those extra 30 minutes because the first time is 330.
Program #4 • Write a program that calculates the elapsed time in minutes between a start time and an end time. • The times will be expressed as integers on a 24-hour clock (use military time). • Include two functions: O A function that returns a Boolean value of true if the ending time is greater than the beginning time and a value of false if the ending time is less than the beginning time. . Use this function to error check the input. Send the function two inputs through the parameter list as byValue: the beginning time and the ending time. • The function will return a true or a false through the function name. • Return a true if the beginning time is less than the ending time. • Return a false if the ending time is less than the beginning time. . If the function returns a true to main then calculate the elapsed time. . If the function returns a false then print out an error message stating that the beginning time must be less than the ending time. • A function that calculates the elapsed time in minutes only between a start time and an end time. • The times will be expressed as integers on a 24-hour clock (use military time). This function must convert them and compute the lapsed time. • The function will take two inputs as byValue in the parameter list: the start time and the end time. The function will return the elapsed time through the function name. - The elapsed time will be in minutes. For example, if the beginning time is 330 (3:30 am) and the ending time is 1900 (7:00 pm) then the elapsed time is 930 minutes. • Be sure to include the prologue information. • Be sure to include the initial and refined algorithms for the main function. • To express the time in military: o Only use times on the hour or half hour. o You need to only deal with end times occurring later on the same day as the start time. For example, the ending time must be greater than the beginning time. o Examples of how times will be represented are as follows: • Midnight will be represented as 0. • 1:00 am will be represented as 100. • 10:00 am will be represented as 1000. 12 noon will be represented as 1200. • 3:30 pm will be represented as 1530. • Have the User enter the time without a colon. For example, 8:30 pm will be entered as 2030. • Use a While loop to allow the User to run the program more than once. Use a sentinel value of "Y" and prompt the User to enter a "Y" if they wish to continue. • HINT: It's easy to figure out the number of minutes when both the ending and beginning times are on the hour like 7:00 pm. It gets tricky when you have a time on the half hour like 3:30 am. You will need to strip away the 30 minutes from 3:30 am first. • Remember that the difference between the times must be computed in minutes. So if the user enters 330 and 1900, you first compute the number of hours (which is 15 hours) and multiply this by 60 for total minutes. You then add those extra 30 minutes because the first time is 330.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
c++ please
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education