1 " "LOCK :CLEAR :WAIT 90:USING :DIM ME$(0)*26:ON ERROR GOTO 900
2 CLS :CURSOR 10:PRINT "BONDS":PRINT "  Copr. 1982 Tandy Corp."
10 RESTORE :WAIT 0:FOR I=1TO 4: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 3:IF MID$ ("PYX",K,1)=A$LET J=K:K=7
13 NEXT K:IF J>0LET I=4:NEXT I:WAIT :GOTO A$
14 NEXT I:GOTO 10
20 DATA "Select Function:"
21 DATA "Find bond price: P"
22 DATA "Find bond yield: Y"
23 DATA "Exit program: X"
100 "P"GOSUB "IMV":GOSUB "INY":GOSUB "ICV":INPUT "Bond yield? (%) ";Y
110 R=Y/100+1:A=M*R^-N:Z=0:FOR J=1TO N:T=R^-J:Z=Z+T:NEXT J
120 P=I*Z+A:P=.01*(INT (P*100+.5)):PRINT "Bond price is $";STR$ P:GOTO 10
200 "Y"INPUT "Bond price? $";P
210 GOSUB "IMV":GOSUB "INY":GOSUB "ICV":IF N<>1GOSUB "YLD":GOTO 230
220 Y=((M+I)/P-1)*100
230 X=Y:GOSUB "RO":Y=X:PRINT "Bond yield is";Y;"%":GOTO 10
300 "ICV"INPUT "Coupon value? $";I
301 RETURN 
310 "INY"INPUT "Number of years? ";N
311 RETURN 
320 "IMV"INPUT "Maturity value? $";M
321 RETURN 
500 "YLD"WAIT 0:CLS :CURSOR 5:PRINT "*** COMPUTING ***":WAIT :A=1:D=.5:C=D
510 "LP1"E=C
520 FOR J=1TO N-1:E=(E+1)*C:NEXT J
530 F=C^N*M+E*I:X=F:GOSUB "RO":F=X:IF F>=PTHEN "LP2"
540 D=C:C=(C+A)/2:GOTO "LP1"
600 "LP2"IF F=PTHEN "LP3"
610 A=C:C=(C+D)/2:GOTO "LP1"
700 "LP3"Y=(1/C-1)*100:RETURN 
800 "RO"X=.001*(INT (X*1000+.5)):RETURN 
900 PRINT "*** ERROR";PEEK &789B;" in";STATUS 4;" ***":GOTO 10
999 "X"UNLOCK :END
