Write a program that will calculate and print bills for the city power company. The rates vary depending on whether the use us residential, commercial, or industrial. A code of R means residential use, a code of C means commercial use, and a code of I means industrial use. Any other code should be treated as an error. The rates are computed as follows: R: $6.00 plus $0.052 per kwh used. C: $60.00 for the first 1000 kwh and $0.045 for each additional kwh. I: Rate varies depending on time of usage Peak hours: $76.00 for first 1000kwh and %0.065 for each additional kwh. Off-peak hours: $40.00 for first 1000 kwh and $0.028 for each additional kwh. Your program should prompt the user to enter an integer account number, the use code (type char), and the necessary consumption figures in whole numbers of kilowatt-hours. Your program should display the amount due from the user.
Construct C++ program to solve a given problem using appropriate
Write a program that will calculate and print bills for the city power company. The rates vary depending on whether the use us residential, commercial, or industrial. A code of R means residential use, a code of C means commercial use, and a code of I means industrial use. Any other code should be treated as an error.
The rates are computed as follows:
R: $6.00 plus $0.052 per kwh used.
C: $60.00 for the first 1000 kwh and $0.045 for each additional kwh.
I: Rate varies depending on time of usage
Peak hours: $76.00 for first 1000kwh and %0.065 for each additional kwh.
Off-peak hours: $40.00 for first 1000 kwh and $0.028 for each additional kwh.
Your program should prompt the user to enter an integer account number, the use code (type char), and the necessary consumption figures in whole numbers of kilowatt-hours. Your program should display the amount due from the user.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images