1 " "LOCK :WAIT 90:CLEAR :USING :DIM ME$(0)*26:ON ERROR GOTO 950
2 CLS :CURSOR 7:PRINT "DEPRECIATION":PRINT "  Copr. 1982 Tandy Corp."
10 RESTORE :WAIT 0:FOR I=1TO 5:CLS :READ ME$(0):PRINT ME$(0):FOR J=1TO 75:A$=INKEY$ :IF A$<>""LET J=75
11 NEXT J
12 J=0:FOR K=1TO 4:IF MID$ ("ABCX",K,1)=A$LET J=K:K=4
13 NEXT K:IF J>0LET I=5:NEXT I:WAIT :GOTO A$
14 NEXT I:GOTO 10
20 DATA "Select Function:"
21 DATA "Straight line: A"
22 DATA "Double declining: B"
23 DATA "Sum of years digits: C"
24 DATA "Exit program: X"
100 "A"GOSUB "INP":GOSUB "YN"
110 "ENT"V=A-F:R=A:S=V/N:X=S:GOSUB "RO":S=X
120 FOR J=1TO N:D=S:V=V-D:R=R-D:IF Y>JTHEN "LP1"
130 GOSUB "DS":GOSUB "YI":IF Y<=JTHEN "ENT"
140 "LP1"NEXT J:GOTO "DC"
200 "B"GOSUB "INP":GOSUB "YN"
210 "ENT1":V=A:R=A:S=2/N:FOR J=1TO N:D=S*V:X=D:GOSUB "RO":D=X:V=V-D:R=R-D
220 IF Y>JTHEN "LP2"
230 GOSUB "DS":GOSUB "YI":IF Y<=JTHEN "ENT1"
240 "LP2"NEXT J:GOTO "DC"
300 "C"GOSUB "INP":GOSUB "YN"
310 "ENT2":V=A-F:R=A:S=N*(N+1)/2:FOR J=1TO N:D=V*(N-J+1)/S:X=D:GOSUB "RO":D=X:R=R-D
320 IF Y>JTHEN "LP3"
330 GOSUB "DS":GOSUB "YI":IF Y<=JTHEN "ENT2"
340 "LP3"NEXT J
500 "DC"CLS :PRINT "Depreciation complete":GOTO 10
600 "RO"X=INT (X)+(INT ((X-INT (X))*100+.5)/100):RETURN 
700 "INP"INPUT "INITIAL value? $";A
710 INPUT "FINAL value? $";F
720 INPUT "NUMBER of years? ";N
730 Y=1:RETURN 
800 "YI"Y=Y+1
810 "YN"CLS :WAIT 0:PRINT "Year =";Y;:INPUT ". Change? ";Y
820 WAIT :RETURN 
900 "DS"BEEP 2:CLS :PRINT "Year";J;": depr. $";STR$ D:CLS :PRINT "Curr. value $";STR$ R:RETURN 
950 PRINT "*** ERROR";PEEK &789B;" in";STATUS 4;" ***":GOTO 10
999 "X"UNLOCK :END
