Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 5 Gas Supply Billing

# Example 6: Gas Supply Billing

#### File: /Learning Plan 5/example4_6.html

### Problem Statement

> The Gas Company records its customers' gas usage data in a Customer Gas Usage Records Set. Each record in the set contains the customer's number, name address, and gas usage expressed in cubic yards. Design a program that will read the customer record set, calculate the amount owed for gas usage for each customer, and then print (i.e. display) a report listing each customer's number, name, address, gas usage and the amount owed.

> The company bill its customers according to the following rate: if the customer's usage is 60 cubic yards or less, a rate of $2.00 per cubic yard is applied. If the customer's usage is more than 60 cubic yards, then a rate of $1.75 per cubic yard is applied for the first 60 cubic yards and $1.50 per cubic yard for the remaining usage.

> At the end of the report, print the total number of customers and the total amount owing to the company.

### Program Planning Lists

- The Planning Lists (see also the structure chart passed out in class)

### The Test Plan

- And the test plan

### JavaScript Output

- Write the JavaScript code based on everything you've done.

- Here's the code:

- Here's the output:

### Customer Usage Figures

Customer Number | Customer Name | Address | Gas Used | Amount Owed
--- | --- | --- | --- | ---