Write a program that calculates and prints the bill for a telephone and cable co
ID: 3557929 • Letter: W
Question
Write a program that calculates and prints the bill for a telephone and cable company. The company offers two types of cable service: Basic and VIP. Its rates vary, depending on the type of service. The rates are computed as follows:
Basic Service:
Bill Processing Fee: $5.75
Service Fee: $45.50
Premium Channels: $7.50 per channel for the first 2 channels, $11.50 for each additional channel
VIP Service:
Bill Processing Fee: $5.75
Service Fee: $45.50
VIP Service Fee: $10
Premium Channels: $7.50 per channel for the first 4 channels, $10.75 for each additional channel
The company also offers two types of telephone service: regular and premium. Its rates vary, depending on the type of service. The rates are computed as follows:
Regular Service:
$20 plus:
the first 65 minutes are free. Charges for over 65 minutes are $0.20 per minute.
Premium Service:
$45 plus:
For calls made from 6:00 am to 6:00 pm, the first 85 minutes are free; charges over 85 minutes are $0.10 per minute.
For calls made from 6:00 pm to 6:00 am, the first 100 minutes are free; charges for over 100 minutes are $0.05 per minute.
A customer can have either the telephone or cable service or both. Your program should prompt the user to enter an account number, a cable service code of type char, the number of premium channels to which the user subscribes, a telephone service code of type char, and the number of minutes the telephone service was used. For the cable service, a service code of b or B means basic service; a service code of v or V means VIP service. For the telephone service, a service code of r or R means regular service; a service code of p or P means premium service. Treat any other character as an error. Your program should inform the user of the error then ask the user to re-enter the code repeatedly until a correct code is given. Your program should output to a file, "output.txt", the account number, type of cable service, number of premium channels, type of telephone service, number of minutes the telephone service was used, and the amount due from the user.
Your program should only get the relevant input and output the corresponding values for the services which the user has.
Test your program with the following data: