Charge Account Bargraph

See all articles from T-S Horizons n11

TS1000 or TS 2068

Like many other modern consumers, the plastic money in my pocket sometimes spends a little easier than I would like it to. And when the bills come in, the balances are invariably higher than what I remember spending. Those charges add up fast! Fortunately, though, this gives me an excuse to write another ZX/TS Home Applications program – a monthly charge account monitor/bar graph designed to provide incentive to reduce those balances month by month, and watch the graph lines grow shorter.

The program accommodates amounts up to $999.00. This figure can be adjusted if needed by changing the digits in line 37 and the plot formulas in lines 170 and 175. It graphs your balances horizontally and prints the dollar amounts numerically in the far right-hand column for each to twelve months. A separate graph can be made for each account.

Lines 140-200 are the heart of the program and are particularly interesting. Lines 140 and 150 call out three letters at a time for M$ (in line 110) and print them at the appropriate times. Line 140 not only controls the number of passes through the FOR 0 NEXT loop but also specifies the month for which data is being processed – thus performing two functions simultaneously. Lines 170 and 175 control the length of the graph bars, while lines 190 and 195 control the screen lines to be graphed and to hold numeric dollar amounts.

Of course, the program could be useful for other purposes also. By changing the print statements in lines 10 and 36, it could be used in small business for monitoring monthly expense accounts, new customers per month, total sales, almost anything. A bar graph makes numbers more tangible.

Sample screen - Charge account balances bar graph
Sample screen – Charge account balances bar graph

TS 1000 VERSION

  1 REM CHARGE ACCOUNT
2 REM BY R.E.WOISH - 1/30/84
10 PRINT "CHARGE ACCOUNT BALANCES BY MONTH"
20 PRINT AT 2,0;"ENTER YEAR"
24 INPUT Y
26 PRINT AT 2,28;Y
28 PRINT AT 2,0;"ACCOUNT NAME ?"
30 INPUT N$
32 PRINT AT 2,0;" "
34 PRINT AT 2,0;N$
36 PRINT AT 4,8;"BALANCE ON ACCOUNT:"
37 PRINT ,,"[spaces, then inverse video: 0,1,2,3,4,5,6,7,8,9,10 and inverse spaces - exact spacing illegible]"
38 LET A$="MONTH"
40 FOR A=8 TO 16 STEP 2
50 PRINT AT A,1;A$(1)
60 LET A$=A$(2 TO )
70 NEXT A
75 FOR A=7 TO 18
80 PRINT AT A,6;"▒"
85 NEXT A
90 FOR A=1 TO 12
95 PRINT AT A+6,4;A
99 NEXT A
100 LET L=28
105 LET K=7
110 LET M$="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
140 FOR X=1 T[illegible] 34 STEP 3
150 PRINT AT 20,0;"ENTER BALANCE AS OF ";M$(X TO X+2)
160 INPUT B
170 FOR D=1 TO B/12.5
175 PLOT 14+D/2,L
180 NEXT D
185 PRINT AT K,29;B
190 LET L=L-2
195 LET K=K+1
200 NEXT X
210 PRINT AT 20,0;"FOR HARD COPY HIT ""C"" "
220 INPUT C$
230 IF C$="C" THEN GO TO 250
240 STOP
250 PRINT AT 20,0;"SAVE FOR FUTURE REFERENCE"
260 IF C$="C" THEN COPY

FOR THE TS 2068

Change line 175 to

175 PLOT 56+2*D,L*4

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.