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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Construct C++ program to solve a given problem using appropriate programming techniques.

 

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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY