Q. Write an algorithm to display the total water bill charges of the month depending upon the number of units consumed by the customer as per the following criteria:


• for the first 100 units @ 5 per unit

• for next 150 units @ 10 per unit

• more than 250 units @ 20 per unit


Also add meter charges of 75 per month to calculate the total water bill .


Answer:-

Input unit

If unit <= 100 then
    Bill = unit * 5

Elif unit <= 150 then
     Bill = unit * 10

Elif unit <= 250 then
     Bill = unit * 20

Calculate total bill = bill + 75
Print total bill

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post