Suppose that your electric company charges you once per year for the electricity you use.   Suppose the electric company charges you $0.06  per kilowatt-hour for the first 1000 kilowatt hours you use and $0.08 per kilowatt-hour for all kilowatt-hours more than 1000 that you use. Write an algorithm that loops to ask the user to enter the number of kilowatt-hours used for each of the last 12 months,  computes and prints the amount to be charged that month, and afterwards prints the total amount to be charged for 12 months worth of electric usage.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter4: Control Structures I (selection)
Section: Chapter Questions
Problem 20PE: The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a...
icon
Related questions
Question

Suppose that your electric company charges you once per year for the electricity you use.   Suppose the electric company charges you $0.06  per kilowatt-hour for the first 1000 kilowatt hours you use and $0.08 per kilowatt-hour for all kilowatt-hours more than 1000 that you use.

Write an algorithm that loops to ask the user to enter the number of kilowatt-hours used for each of the last 12 months,  computes and prints the amount to be charged that month, and afterwards prints the total amount to be charged for 12 months worth of electric usage.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr