Household Finances

Developer(s): James Holder
Date: 1982
Type: Program
Platform(s): ZX81, TS 1000
Tags: Finance

Setup comes first, as the article explains: enter DIM A$(10,13) as a command, then GOTO 800 and type the names of your ten categories (eight expenses and two income); then delete lines 800-820 and start with GOTO 10, not RUN, which would clear the names. Use M and N to clear the month and year totals.

Entries are a category letter followed by the amount, for example A9.95. K shows the current statement (CONT returns), and L saves the program with your data so it starts itself when loaded. It needs 16K. The download includes lines 800-820 so you can do the setup.

Published in Syntax July 1982 (Household Finances — 8K/16K).

Related Articles

Personal finance program for tracking household income and expenses in up to 10 user-defined categories (8 expense, 2 income). Includes monthly and yearly summaries, a self-saving option, and protection against accidental erasure. Requires 8K ROM and 16K RAM, leaving ~12.6K for data.

Image Gallery

Source Code

  10 CLS
  20 PRINT AT 2,6;"HOUSEHOLD FINANCES ";AT 4,0;"ENTER LETTER AND AMT. AS ""A9.95""";AT 6,2;"A=";A$(1);AT 6,14;"F=";A$(6);AT 7,2;"B=";A$(2);AT 7,14;"G=";A$(7);AT 8,2;"C=";A$(3);AT 8,14;"H=";A$(8);AT 9,2;"D=";A$(4);AT 9,14;"I=";A$(9);AT 10,2;"E=";A$(5);AT 10,14;"J=";A$(10);AT 12,7;"ENTER LETTER ONLY";TAB 2;"K=STATEMENT";TAB 14;"M=CLEAR MONTH";TAB 2;"L=SAVE";TAB 14;"N=CLEAR YEAR";AT 16,0;"INSURANCE BENEFITS ARE NEGATIVE.NEGATIVE BALANCE SHOWS BENEFITS EXCEED PREMIUMS."
  30 INPUT Z$
  40 IF CODE Z$=48 THEN GOTO 120
  50 IF CODE Z$=49 THEN GOTO 620
  60 IF CODE Z$=50 THEN DIM A(10)
  70 IF CODE Z$=51 THEN DIM B(10)
  80 IF CODE Z$>47 THEN GOTO 30
  90 LET A(CODE Z$-37)=A(CODE Z$-37)+VAL Z$(2 TO )
 100 LET B(CODE Z$-37)=B(CODE Z$-37)+VAL Z$(2 TO )
 110 GOTO 30
 120 CLS
 130 DIM M(2)
 140 LET S=350
 150 PRINT AT 2,6;"CURRENT STATEMENT  ";AT 4,0;"CATEGORY";TAB 16;"MONTH";TAB 25;"YEAR"
 160 LET T=5
 170 FOR K=1 TO 10
 180 LET M(1)=A(K)
 190 LET M(2)=B(K)
 200 PRINT AT T,0;A$(K);TAB 14;"$";TAB 19;".00 $";TAB 29;".00"
 210 LET U=14
 220 FOR J=1 TO 2
 230 IF M(J)<0 THEN GOTO 250
 240 IF M(J)<10000 THEN LET U=U+1
 250 IF ABS M(J)<1000 THEN LET U=U+1
 260 IF ABS M(J)<100 THEN LET U=U+1
 270 IF ABS M(J)<10 THEN LET U=U+1
 280 PRINT AT T,U;M(J)
 290 LET U=24
 300 NEXT J
 310 LET T=T+1
 320 IF K=8 OR S=460 OR S=540 THEN GOTO S
 330 NEXT K
 340 GOTO S
 350 LET Q=0
 360 LET R=0
 370 FOR J=1 TO 8
 380 LET Q=Q+A(J)
 390 LET R=R+B(J)
 400 NEXT J
 410 LET S=460
 420 PRINT AT T,0;"TOTAL EXPENSE";TAB 14;"$";TAB 19;".00 $";TAB 29;".00"
 430 LET M(1)=Q
 440 LET M(2)=R
 450 GOTO 210
 460 LET T=T+1
 470 LET S=490
 480 NEXT K
 490 PRINT AT T,0;"TOTAL INCOME";TAB 14;"$";TAB 19;".00 $";TAB 29;".00"
 500 LET M(1)=A(9)+A(10)
 510 LET M(2)=B(9)+B(10)
 520 LET S=540
 530 GOTO 210
 540 LET T=T+1
 550 PRINT AT T,0;"PROFIT/LOSS";TAB 14;"$";TAB 19;".00 $";TAB 29;".00"
 560 LET M(1)=A(9)+A(10)-Q
 570 LET M(2)=B(9)+B(10)-R
 580 LET S=600
 590 GOTO 210
 600 STOP
 610 GOTO 10
 620 CLS
 630 PRINT AT 6,0;"PREPARE TO SAVE; START RECORDER RUNNING; TOUCH ""N/L"""
 640 PAUSE 40000
 650 SAVE "HOUSEHOLD FINANCES"
 660 GOTO 10
 800 FOR K=1 TO 10
 810 INPUT A$(K)
 820 NEXT K

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