Create Program Plan, Algorithm, and Flowchart. An electric company bases its charges on two rates, customers are charged P 25.00 per kilowatt-hour for the first 300 kilowatt-hours used in a month and P 30.00 each for all kilowatt-hours used thereafter. Compute for the amount due from a customer after reading the kilowatt-hours used. Assume that there are 100 records of customers.
Program Plan
1. Declare variables
2. Read kilowatt-hour
3. Create for loop, if statements
4. Display amountDue
Algorithm:
Start
Declare variables kilowattHour, amountDue,i
Set i = 0
for i=1 to 100 Step 1 do
Read kilowattHour
if kilowattHour<=300 then
amountDue=kilowattHour*25.00
else
amountDue=300*25.00+(kilowattHour-300)*30.00
End if
Display amountDue
end while
Stop
Flowchart
Comments
Leave a comment