Computer Science, asked by saarya8887, 2 months ago

write a program in java to accept the total units consumed by a customer and calculate the bill, if the electricity board charges the bill according to the number of units consumed:
First 100 units- 80 paisa per unit.
Next 200 units- Rs 1 per unit.
Above 300 units- Rs 2.50 per unit.​

Answers

Answered by sangeetseth626
1

Answer:

Explanation:

Input: U = 250

Output: 3500

Explanation:

Charge for the first 100 units – 10*100 = 1000

Charge for the 100 to 200 units – 15*100 = 1500

Charge for the 200 to 250 units – 20*50 = 1000

Total Electricity Bill = 1000 + 1500 + 1000 = 3500

Input: U = 95

Output: 950

Explanation:

Charge for the first 100 units – 10*95 = 950

Total Electricity Bill = 950

Similar questions