10 CLEAR :DIM ME$(0)*26,A(14,2):WAIT 90:CLS :PRINT "Budget Management 2"
20 PRINT "Copr. 1982 Tandy Corp."
21 " "CLS :WAIT :PRINT "(N)ew Month,(A)lter,(D)isp":PRINT "(G)raph,(S)ave,(L)oad":GOTO 21
30 "N"IF U=0GOTO 540
35 V=V+1:W=0
40 GOSUB 550:FOR P=0TO U-1:GOSUB 500:X=0:IF WLET X=A(P,2):GOSUB 530
50 GOSUB 510:IF X=0GOTO 50
60 NEXT P:GOTO 21
70 "A"IF V=0GOTO 540
75 W=1:GOTO 40
100 "D"GOSUB 550:IF V=0GOTO 540
110 FOR P=0TO U-1:GOSUB 500:GOSUB 530:PRINT "YTD $";A(P,1):T=T+A(P,2):Y=Y+A(P,1)
120 PRINT "Monthly Avg $";A(P,1)/V:NEXT P
130 PRINT "Total $";T:PRINT "YTD Total $";Y:PRINT "Monthly Avg $";Y/V:GOTO 21
140 "G"GOSUB 550:IF V=0GOTO 540
145 TEXT :Q=0:FOR P=0TO U-1:FOR R=0TO 2STEP 2:IF A(P,R)>QLET Q=A(P,R)
150 NEXT R:NEXT P:LF 8:GRAPH :SORGN :LINE (0,0)-(216,-5),,0,B:CSIZE 1:USING "######":FOR P=4TO 1STEP -1
170 GLCURSOR (0,P*25-3):LPRINT P*Q/4:NEXT P:R=80/U:COLOR 2:FOR P=0TO U-1:X=3:W=A(P,0):T=T+W
180 GOSUB 220:NEXT P:GLCURSOR (0,0):COLOR 3:FOR P=0TO U-1:X=R+1:W=A(P,2):Y=Y+W:GOSUB 220:NEXT P:ROTATE 1
190 GLCURSOR (0,0):COLOR 0:FOR P=0TO U-1:GLCURSOR (2*R*P+R+47,-10):LPRINT @$(P+1):NEXT P:GLCURSOR (0,-90):COLOR 0:TEXT 
200 USING "######.##":CSIZE 1:LCURSOR 5:LPRINT "Total Budgeted $";T:LF 1:LCURSOR 5:LPRINT "Total Spent    $";Y
210 LCURSOR 22:LPRINT "---------":LCURSOR 5:LPRINT "Net";TAB 20;"$";T-Y:LF 8:GOTO 21
220 X=51+2*R*P+X:LINE (X,0)-(X+R-3,100*W/Q),,,B:RETURN 
230 "S"CLS :PRINT "Load Blank Tape !":PRINT #"BGDATA";@$(*),A(*),U,V:GOTO 21
240 "L"CLS :USING :PRINT "Load Data Tape !":INPUT #"BGDATA";@$(*),A(*),U,V:PRINT "Month";V;" Load
250 GOTO 21
500 PRINT @$(P+1):PRINT "Amt Budgeted $";A(P,0):RETURN 
510 INPUT "Amt Spent ?";A(P,2):A(P,1)=A(P,1)+A(P,2)-X:X=1
520 RETURN 
530 PRINT "Amt Spent $";A(P,2):RETURN 
540 PRINT "No Data !":GOTO 21
550 T=0:Y=0:CLS :WAIT :USING "######.##":RETURN 
1000 "X"END
