Question
C++: Write a program that prompts the user for the starting time and the number of minutes of the call and display the charges. The
C++: Write a program that prompts the user for the starting time and the number of minutes of the call and display the charges. The charges are based on the start time of the call and use the correct rate for the time range it falls into (see table below). The start time will be entered as a floating point number (decimal) in the form HH.MM. For example, 07:00 would be entered as 07.00 and 16:28 will be entered as 16.28.
Must not accept times that are greater than 23.59 (note that 6.69 is less than 23.59 but is an invalid time).
Must not accept time whose last two digits are greater than 59.
HINT the following expression will give you its fractional part num static_cast
Validate that the number of minutes of the phone call is not negative
Named constants must be used for the values in the following table.
Start Time of Call | Rate Per Minute |
00:00 06:59 | 0.12 |
07:00 12:59 | 0.23 |
13:00 19:00 | 0.55 |
19:01 23.59 | 0.35 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started