Electricity Bill
Electricity Bill
NO: 1A
APPLICATION OF PROBLEM SOLVING TECHNIQUE – ELECTRICITY BILL
DATE:8/12/2
2
PROBLEM STATEMENT:
Write the pseudo code,algorithm and draw a flowchart to generate electricity bill according to the
given condition.
1.for 1st 50 units – 50 paise/unit
2.for next 100 units – 75paise/unit
3.for next 100 units – 1.20paise/unit
4.for units greater than that – 1.50/unit
And additional surge charge of 20% is added to the bill
Calculate the amount and print the bill.
ALGORITHM:
Step 1:start
Step 2:read the number of units,n
Step 3:if n lesser than or equal to 50
Calculate total = n*0.5
Step 4:check if n lesser than or equal to 150
Calculate total = (n-50)*0.75+50*0.5
Step 5:check if n lesser than or equal to 250
Calculate total = (n-150)*1.2+100*0.75+50*0.5
Step 6:check if n greater than 250
Calculate total =(n-250)*1.5+100*1.2+100*0.75+50*0.5
Step 7:calculate total =total*1.2
Step 8:print total
Step 9:stop
PSEUDO CODE:
READ n
If(n<=50)
Total =n*0.5
ELIF(n<50)and (n<150)
Total =(n-50)*0.75+50*0.5
ELIF(n<=250)
Total = (n-150)*1.2+100*0.75+50*0.5
ELSE(n>250)
Total = (n-250)*1.5+100*1.2+100*0.75+50*0.5
Total = total+1.2
END IF
WRITE total
FLOWCHART:
start
Read n
If (n<=50)
Elif(n<=50)&
(n<=150)