ZX80 Budget

Developer(s): Quentin I. Smith
Date: 1981
Type: Program
Platform(s): ZX80
Tags: Finance

RUN asks for 18 three-digit cost codes, one per budget category. Then answer 1 to make an entry: give the cost code, the dollars and the cents. Any other answer shows the totals for each code and the grand total. GO TO 150 adds more entries later, and GO TO 290 shows the totals again.

In the October 1981 issue the author sent changes that print cents below 10 with a leading zero (delete line 2015, change 2020 to GO TO 160 and add lines 335-345 and 385-395); the printed “new Syntactic Sum” fits the changed program without line 345. The download has the program as printed and with the changes.

Although the heading says 1K, in testing it stopped with error reports (3 and 4) in a 1K ZX80; it runs in 2K. As printed, an amount of 7 dollars 5 cents is shown as 7.5; the changed version shows 7.05.

Published in Syntax September 1981 (ZX80 Budget).

Related Articles

Can keep track of expenses. As written, program keeps addition totals on 18 accounts.

Related Content

Image Gallery

Source Code

  10 DIM X(18)
  20 DIM Y(18)
  30 DIM Z(18)
  40 FOR J=1 TO 18
  50 PRINT "ENTER CODE"
  60 INPUT X(J)
  70 CLS
  80 NEXT J
  90 FOR J=1 TO 18
 100 PRINT X(J),
 110 NEXT J
 120 CLS
 130 PRINT "ENTER 1(NL) TO CONTINUE BUDGET ENTRIES"
 140 INPUT T
 145 IF T=1 THEN GO TO 150
 147 GO TO 290
 150 CLS
 160 PRINT " ENTER COST CODE"
 170 INPUT A
 180 PRINT "ENTER COST DOLLARS"
 190 INPUT B
 200 PRINT " ENTER COST CENTS"
 210 INPUT C
 220 FOR J=1 TO 18
 230 IF X(J)=A THEN LET Y(J)=Y(J)+B
 240 IF X(J)=A THEN LET Z(J)=Z(J)+C
 250 IF Z(J)>99 THEN GO SUB 1000
 260 IF X(J)=A THEN GO TO 120
 270 NEXT J
 280 IF J=19 THEN GO TO 2000
 290 CLS
 300 LET D=0
 310 LET E=0
 320 PRINT "CODE","AMOUNT"
 330 FOR J=1 TO 18
 340 PRINT X(J),Y(J);".";Z(J)
 350 LET D=D+Y(J)
 360 LET E=E+Z(J)
 370 NEXT J
 380 IF E>99 THEN GO SUB 4000
 390 PRINT "TOTAL",D;".";E
 400 STOP
1000 LET Z(J)=Z(J)-100
1010 LET Y(J)=Y(J)+1
1020 RETURN
2000 CLS
2010 PRINT "CODE NOT FOUND - RE-ENTER"
2015 CLS
2020 GO TO 150
4000 LET E=E-100
4010 LET D=D+1
4020 IF E>99 THEN GO TO 4000
4030 RETURN

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