Write a program that calculate electricity bill. The program prompts the user to enter the amount of KWh units of electricity consumed, the task is to calculate the electricity bill total with the help of the below charges: • 1 to 50 units of total units-Unit price-10 • 50 to 100 units of total units- Unit price-15 above 100 units - Unit price=20

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 13E: Write a program named MakeChange that calculates and displays the conversion of an entered number of...
icon
Related questions
Question
Write a program that calculate electricity bill. The program prompts the user to enter the amount of KWh units of
electricity consumed, the task is to calculate the electricity bill total with the help of the below charges:
• 1 to 50 units of total units - Unit price=10
• 50 to 100 units of total units - Unit price=15
• above 100 units - Unit price=20
Sample Runl:
Enter the amount of KWh units U: 250
Total Bill: 4250
Explanation:
Charge for the first 50 units - 10 50 500
Charge for the 50 to 100 units - 15 50 - 750
Charge for the 100 to 250 units - 20*150 - 3000
Sample Run2:
Enter the amount of KWh units U: 95
Total Bill: 1175
Explanation:
Charge for the first 100 units - 10*50 - 500
Charge for the 50 to 100 units - 15 45 675
Transcribed Image Text:Write a program that calculate electricity bill. The program prompts the user to enter the amount of KWh units of electricity consumed, the task is to calculate the electricity bill total with the help of the below charges: • 1 to 50 units of total units - Unit price=10 • 50 to 100 units of total units - Unit price=15 • above 100 units - Unit price=20 Sample Runl: Enter the amount of KWh units U: 250 Total Bill: 4250 Explanation: Charge for the first 50 units - 10 50 500 Charge for the 50 to 100 units - 15 50 - 750 Charge for the 100 to 250 units - 20*150 - 3000 Sample Run2: Enter the amount of KWh units U: 95 Total Bill: 1175 Explanation: Charge for the first 100 units - 10*50 - 500 Charge for the 50 to 100 units - 15 45 675
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT