Computer Science, asked by deepmalagupta141, 9 months ago

Write an OOP to calculate electricity bill as per following criteria:

First 100 unit: Rs. 2 per unit

Next 200 Unit: Rs 3.00

Above 300 unit: Rs. 500​

Answers

Answered by Anonymous
5

Answer:

Program to calculate Electricity Bill

Given an integer U denoting the amount of KWh units of electricity consumed, the task is to calculate the electricity bill with the help of the below charges:

1 to 100 units –

Rs. 10/unit

100 to 200 units –

Rs. 15/unit

200 to 300 units –

Rs. 20/unit

above 300 units –

Rs. 25/unit

Examples:

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

Explanation:

plzz mark as brainleist

Answered by chanchal2724
1

Answer:

make it's brainlist

Explanation:

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