0% found this document useful (0 votes)
561 views2 pages

Electricity Bill

The document provides an algorithm, pseudocode, and flowchart to generate an electricity bill based on consumption tiers and a surge charge. The algorithm calculates the bill amount based on consumption tiers with different unit rates. It then adds a 20% surge charge to the total before printing the final bill amount. The pseudocode and flowchart represent the logic of the algorithm to first check consumption levels against the tiers, calculate the cost for each tier, and then add the surge charge to get the total bill.

Uploaded by

Madhu Mita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
561 views2 pages

Electricity Bill

The document provides an algorithm, pseudocode, and flowchart to generate an electricity bill based on consumption tiers and a surge charge. The algorithm calculates the bill amount based on consumption tiers with different unit rates. It then adds a 20% surge charge to the total before printing the final bill amount. The pseudocode and flowchart represent the logic of the algorithm to first check consumption levels against the tiers, calculate the cost for each tier, and then add the surge charge to get the total bill.

Uploaded by

Madhu Mita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EX.

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)

You might also like