Classic Computer Magazine Archive COMPUTE! ISSUE 43 / DECEMBER 1983 / PAGE 72

Utility Bill Audit

Larry L. Bihlmeyer

As utility bills continue to rise, it's a good idea to check them for accuracy. Here's a practical program enabling you to verify your electric, gas, water, and phone bills. Written for all Commodores, TI, Apple, and Color Computer, an Atari version is also included.

"Utility Bill Audit" is a versatile program that lets you check your electric, gas, water, and phone bills for accuracy, or split the costs of these bills among the people living in your household. Also, if you are interested in energy savings (and who isn't these days?), you can monitor your daily electric and gas consumption with this program.

Program 1 will run on all Commodore machines, TI, Apple, and Color Computer. One minor modification, however, is required if you have a TI-99/4A, Apple, or Color Computer. Line 200 contains a statement to clear the screen and cursor home. Substitute the appropriate command for your machine in this line (CALL CLEAR for TI, HOME for Apple, CLS for the Color Computer).

Personalizing The Program

Before you RUN this program, it is necessary to have a thorough understanding of how each bill is calculated in the program. First, a particular bill is split up according to the values (2, 1, 2, 4) given in the DATA statement in line 1640. These values are assigned to the variable N(X) and represent the number of individuals who must pay for each bill. In its present form, the program assumes that the electric and water bills will be paid by two individuals, the phone bill by four, and the gas bill by one individual. However, it's unlikely that these numbers will correspond to the financial arrangements in your household. So, be sure to substitute the appropriate values in this line before you continue. Of course, if the bills are paid by one individual in the house, simply replace all four numbers in line 1640 with 1, 1, 1, 1.

Since the program works on the actual costs of your utility bills based on local rates, certain information about these rates must be provided before you can run the program. This information is READ in line 380 and 400 from the DATA statements in lines 1650 – 1680.

Notice that the first three DATA statements in this sequence have nine entries and apply to the electric, gas, and water bills respectively. Let's consider line 1650 as an example. The first entry in this line is the name of the utility (ELECTRIC) for which the rates that follow apply. The second entry is the unit of measurement for that particular utility (KWH for kilowatt hours). The next entry is the minimum service charge for the utility ($5.40 for electricity). The fourth entry is the tax rate based on the sum of the service charge and the rate charge (0 percent for electric use). These first four DATA entries are READ in as A$(1), B$(1), M(1), and Z(1), respectively.

At this point, the numbers begin to get a little confusing, so read carefully. The next two numbers are cutoff limits for each electric rate and are represented in the program by L1(1) and L2(1). The last three numbers are the actual rates charged per KWH use for each level of usage (R1(1), R2(1), and R3(1) in the program). Thus, the program is presently set up so that the rate charged for electricity is $.0495 for the first 350 KWH, $.0565 for the next 950 KWH (i.e., 1300 minus 350), and $.0541 for any usage exceeding 1300 KWH.

The DATA statement in line 1680 is easier to follow: the utility (PHONE), the minimum service charge ($13.50), and the tax rate on the service charge and long distance calls (3 percent).

So, get out your most recent bills and read off the various rates (per KWH for electric, per CCF or hundred cubic feet for gas and water). If the rates are not given on a bill, contact the utility company to get a schedule of the latest rates. Then just substitute your local rates for those in the DATA statements in lines 1650 to 1680.

Program Operation

After inserting the correct rates, RUN the program. You will then be asked which utility bill you wish to check. The first three menu choices are electric, gas, and water. Bills for these three utilities are all calculated in the routine beginning at line 560. Let s look at an electric bill as an example.

When the routine at line 560 is executed, you will be required to INPUT the present and previous meter readings. These values can be read directly from your latest electric bill. Next, you must INPUT the number of days in the billing period. Then you will be asked to INPUT any adjustments to the bill, either positive (for example, connection fees, previous balances) or negative (credits).

The program will next calculate the amount of electricity consumed for the given period (defined as U in line 720). Then, depending on the value of U relative to the two rate limits, L1(1) and L2(X) (lines 740 and 750), an amount owed (T) before tax and adjustments will be calculated (lines 760, 780, and 800). Next, the tax on this amount will be determined (T1). And finally a total electric bill — the sum of the minimum charge, usage cost, tax, and adjustments — will be calculated (T3) in line 830.

The results are then PRINTed on the screen with provisions for formatting the output to two places past the decimal. Any numbers in the third place past the decimal are simply dropped. If you prefer rounded numbers, you could easily modify the program to achieve that.

The routine beginning at line 560, as mentioned, also calculates the gas and water bills. These are based on the rates READ from the DATA statements in lines 1660 and 1670. Notice the sets of large numbers (precisely, 99999) in line 1660. The rates for gas where I live are the same, regardless of the amount used. By using large numbers here for the cutoff limits, L1(2) and L2(2), for this utility, it's unlikely that the actual usage will exceed these amounts (see lines 740 and 750). Thus, the charge for this commodity will always be based on the first rate, or R1.

The rates for water, as READ from the DATA statement in line 1670, are based on a single cutoff limit (L1(3)) of 1000 CCF. For less than this, a usage rate (R1(3)) of $.144 per CCF is charged. If water usage exceeds 1000 CCF, a second rate (R2(3)) of $.160 is charged. Again, using a very large number (99999) for the second cutoff limit (L2(3)) assures that the overall usage cost is based only on two rates.

Analyzing The Phone Bill

Phone bills are checked in a separate routine in the program beginning at line 1110. In this routine, adjustments to the bill are initially INPUT in the same manner as they are with the electric, gas, and water bills. Next, the person responsible for each long distance charge is required to INPUT the amount of each long distance call. A separate routine (lines 1260 – 1360) allows the individual to correct any typing mistakes. Finally, the amount owed by one individual is displayed.

The portion of the phone bill that each person must pay is the sum of their long distance tolls, a proportional amount of both the service charge and the billing adjustments, and a proportional amount of the tax levied on the service and long distance calls. Again, if only one person in the household foots the bills, the last number in line 1640 should be 1.

In addition to enabling you to catch billing errors and helping you to easily divide up house­hold bills, this program can help you monitor your costs. If you add an energy-saving device that is supposed to save, say, 10 percent of your total electric bill, take a meter reading when it is installed and verify the savings with a later reading. You can also project weekly, monthly, and yearly savings for any utility in this manner.

Atari Version Notes For Utility Bill Audit

Patrick Parrish Programming Supervisor

The Atari version (Program 2) of "Utility Bill Audit" is set up like the Microsoft version. The primary difference in the Atari version, of course, is its handling of strings. A$(X) and BS(X) were used to define the type of utility and its units of usage in the Microsoft version. Since the Atari doesn't allow string arrays, AS and B$ must be defined as one long string of individual substrings representing all utilities and their units. This is accomplished in lines 210 and 220. Thus, when a bill for a particular utility is to be checked, a corresponding portion of A$ and B$ will be accessed accordingly.

As an example of this, look at the statement in line 170. If you were checking an electric bill, then X would equal 1 and the first eight characters in AS or ELECTRIC would be PRINTed along with the word BILL.

After removing entries for AS and B$ from the DATA statements in lines 780 to H10, the remainder of these entries are defined by the same variables as they are in the Microsoft version. Read over the discussion on these DATA statements in the article. Then, adjust the values contained therein according to your local utility rate schedules.