1 " "LOCK :WAIT 90:CLEAR :USING :DIM ME$(0)*26:ON ERROR GOTO 600
2 CLS :CURSOR 6:PRINT "FUTURE VALUES":PRINT "  Copr. 1982 Tandy Corp."
10 RESTORE :WAIT 0:FOR I=1TO 6: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 5:IF MID$ ("RPFNX",K,1)=A$LET J=K:K=5
13 NEXT K:IF J>0WAIT :GOTO A$
14 NEXT I:GOTO 10
20 DATA "Select Function:"
21 DATA "Find rate: R"
22 DATA "Find payment: P"
23 DATA "Find future value: F"
24 DATA "Find number of payments: N"
25 DATA "Exit program: X"
100 "R"GOSUB "IFV":GOSUB "IPMT":GOSUB "INP":GOSUB "PD"
110 B=A/P:R=B/(N*N)-1/B:IF R<0CLS :BEEP 3:PRINT "INVALID!":GOTO 10
120 "R1"C=(1+R)^N-1:D=C-R*B:E=D/(C/(-R)+N*(1+R)^(N-1))
130 R=R-E:IF ABS E>=1E-7THEN "R1"
140 I=R*M*100:I=.01*INT (100*I+.5)
150 PRINT "True rate is";I;"%":GOSUB "SUM":GOTO 10
200 "P"GOSUB "IFV":GOSUB "ITR":GOSUB "INP":P=A*R/((1+R)^N-1)
210 P=.01*INT (100*P+.5):PRINT "Payment is $";STR$ P:GOSUB "SUM":GOTO 10
300 "F"GOSUB "IPMT":GOSUB "ITR":GOSUB "INP":A=P*((1+R)^N-1)/R:A=.01*INT (100*A+.5)
310 PRINT "Future value is $";STR$ A:GOSUB "SUM":GOTO 10
400 "N"GOSUB "IFV":GOSUB "ITR":GOSUB "IPMT"
410 N=(LOG (1+A*R/P))/(LOG (1+R))
420 PRINT INT N+(N<>INT N);" payments":GOSUB "SUM":GOTO 10
500 "IFV"INPUT "Future value? $";A
501 RETURN 
510 "IPMT"INPUT "Payment? $";P
511 RETURN 
520 "INP"INPUT "Number of payments? ";N
521 RETURN 
530 "ITR"INPUT "True interest rate in %? ";I
531 GOSUB "PD":R=I/(M*100):RETURN 
540 "SUM"S=.01*INT (P*N*100+.5):T=.01*INT ((A-S)*100+.5)
545 PRINT "Sum of payments $";STR$ S:PRINT "Interest is $";STR$ T:RETURN 
550 "PD"INPUT "Periods per year? ";M
551 RETURN 
600 PRINT "*** ERROR";PEEK &789B;" in";STATUS 4;" ***":GOTO 10
900 "X"UNLOCK :END
