Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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(num) (where num is the start time entered by the user).

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

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_2

Step: 3

blur-text-image_3

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

4. What advice would you give to Carol Sullivan-Diaz?

Answered: 1 week ago