Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programing C Back in the days of long distance, phone calls beyond your local community were billed by the minute, with different rates depending on
Programing C
Back in the days of "long distance," phone calls beyond your local community were billed by the minute, with different rates depending on day of the week and the time of the day that the call was made. (The phone lines were less in use on weekends and at night, when businesses were not using them as extensively.) This program computes a person's phone bill based on this type of calling 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: Any call started between 8:00 a.m. (800 hours) and 6:00 p.m. (1800 hours) during the weekdays is billed at the rate of $0.20 per minute. Any call started after 6:00 p.m. (1800 hours) until 11:00 p.m. (2300 hours) during the weekdays is billed at the rate of $ 0.15 per minute. Any call made during the weekend (Saturday and Sunday) and after 11:00 p.m. and before 8:00 a.m. every day is billed at the rate of $0.10 per minute. The input will consist of the day ('d' for weekday or 'e' for weekend), the time call started, and the length of the call in minutes. The time is to be input in 24-hour notation, without the : that we often use for time. The day of the week will be read as a char. The time and the length will be integer values. You do not have to worry about a call going from one rate to another. For example if the call started at 745 and the length of the call is 30 minutes, your entire call will be calculated at the rate of the time call started. Use #define to declare the rates as constants. . . Use if / else statements in the main of your program You are not required to use functions, but you can if you want. Remember to initialize the sum and the most expensive call to appropriate values. Sample output of the program Enter the day weekday or weekend Enter the time the call started 900 Enter the length of the call 20 weekday 20 minute call started at 900 hrs will cost $ 4.00 d a.exe Enter the day weekday or weekend e Enter the time the call started 100 Enter the length of the call 20 weekend 20 minute call started at 100 hrs will cost $ 2.00 a.exe Total cost $ 6.00 Most expensive call cost $ 4.00Step 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