The Domestic Gas Supply Company records customers’ gas usage figures on a cust
ID: 3535582 • Letter: T
Question
The Domestic Gas Supply Company records customers’ gas usage figures on a customer usage file. Each
record on the file contains the customer’s number, name and address, and their gas usage expressed
in cubic meters. Design a solution algorithm that will read the customer usage file, calculate the
amount owing for gas usage for each customer, and print a report listing each customer’s number,
name, address, gas usage and the amount owing.
The company bills its customers according to the following rate: if the customer’s usage is 60
cubic meter or less, a rate of $2.00 per cubic meter is applied; if the customer’s usage is more
than 60 cubic meters, then a rate of $1.75 per cubic meter is applied for the first 60 cubic meters
and $1.50 per cubic meter for the remaining usage.
At the end of the report, print the total number of customers and the total amount owing to the
Explanation / Answer
STEP-1: START
STEP-2: READ CUSTOMER NUMBER X
STEP-3: READ CUSTOMER USAGE Y
STEP-4: IF Y IS LESS THAN 60 GO TO STEP 6
STEP-5: IF Y IS MORE THAN 60 GO TO STEP-7
STEP 6: CALCULATE USAGE U=Y*$2
STEP-7: CALCULATE Z=Y-60,GO TO STEP-8
STEP-8: CALCULATE USAGE U=60*$1.75+Z*$1.50
STEP:9: OUTPUT U,X
STEP:10 END
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.