Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 254 Weeks Ago, 6 Days Ago |
Questions Answered: | 12843 |
Tutorials Posted: | 12834 |
MBA, Ph.D in Management
Harvard university
Feb-1997 - Aug-2003
Professor
Strayer University
Jan-2007 - Present
Write a C++ program that computes the cost of a long-distance call.
The cost of the call is determined according to the following rate schedule:
   a. Any call started between 8:00 A.M. and 6:00 P.M., Monday through Friday, is billed at a rate of $0.40 per minute.
   b. Any call starting before 8:00 A.M. or after 6:00 P.M., Monday through Friday, is charged at a rate of $0.25 per minute.
   c. Any call started on a Saturday or Sunday is charged at a rate of $0.15 per minute.
The input will consist of the day of the week, the time the call started, and the length of the call in minutes. The output will be the cost of the call. The time is to be input in 24-hour notation, so the time 1:30 P.M. is input as (must be the following format:)
13:30
The day of the week will be read as one of the following pairs of character values, which are stored in two variables of type char:
Mo Tu We Th Fr Sa Su
Be sure to allow the user to use either uppercase or lowercase letters or a combination of the two. The number of minutes will be input as a value of type int.Â
Format your output to two decimal places.
Â
***Validate the user's input using an user-defined function(s).
***Calculate the cost using an user-defined function(s).
***Allow the user to repeat the program.
Â
**************************************************************************************
OUTPUTS:
**************************************************************************************
Â
Â
Enter the first two letters of the day of the week:
Fr
Enter the time the call starts in 24-hour rotation:
20:10
Enter the length of the call in minutes:
10
Cost of the call: $2.50
Â
Do you want to repeat the program?
y
Â
Enter the first two letters of the day of the week:
Su
Enter the time the call starts in 24-hour rotation:
10:10
Enter the length of the call in minutes:
10
Cost of the call: $1.50
Â
Do you want to repeat the program?
n
-----------