An electricity board charges the following rates to domestic users to discourage large consumption of energy:
Unit used (u) Residential rate Commercial rate
0 < units <= 100 6 8
100 < units <= 200 8 13
200 < units <= 400 12 17
500 < units <= 800 17 20
800 < units <= 1000 21 22
Above 1000 23 25
Write a program to read the type of rate (Residential or Commercial) and number of units (previous and current ) consumed and print out the charges
with names.
For Example:
Enter Type of rate : Residential
Enter Previous Units: 2120
Enter Current Units: 2240
Consumed Units : 120
Total Bill is :
Hassaan_3 0 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.