5 CLS
10 PRINT "     RATE OF RETURN - CONSTANT INFLOW"
20 PRINT 
30 PRINT "THIS PROGRAM WILL CALCULATE THE RATE OF RETURN OF AN 
40 PRINT "INVESTMENT COSTING $A NOW AND RETURNING $B DURING EACH OF THE
50 PRINT "NEXT N EQUAL TIME PERIODS(YEARS E.G.)
70 PRINT "INPUT IS THE INITIAL INVESTMENT,PERIODIC DOLLAR RETURNS AND
75 PRINT "NUMBER OF PERIODS.
80 PRINT 
90 INPUT "PRESS ENTER TO BEGIN.";Z9
100 CLS
102 CLEAR 100
105 I=0
110 PRINT:PRINT
120 INPUT "INITIAL INVESTMENT ";A
125 A=-A
130 INPUT "PERIODIC RETURN = ";B
140 INPUT "NUMBER OF PERIODS = ";N
160 R=.01
170 JUMP=.1
174 JN=0:REM JN= NUMBER OF PASSES THROUGH LOOP
175 P=0
180 P= A + B/R*(1-(1+R)[(-N))
190 IF ABS(P) < .5 GOTO 400
194 REM PRINT "B=";B, "N=";N, "B*N=";B*N, "A=";A, "R=";R
195 IF B*N>-A AND R<0 THEN GOTO 300
200 IF P>0 GOTO 300
210 R=R-JUMP
220 JUMP = JUMP/10
230 GOTO 300
300 R=R+JUMP
305 PRINT @ 35,"PASS # ";JN;"  R =";100*R:JN=JN+1
310 GOTO 175
400 REM PRINTING SUBROUTINE
410 PRINT
420 PRINT "RATE OF RETURN IS ";100*R;" % PER PERIOD
422 PRINT
425 PRINT"IF THIS DATA IS MONTHLY WE MAY MULTIPLY BY 12 TO GET AN
430 PRINT"ANNUAL RATE . PRESS <ENTER> FOR THIS COMPUTATION, 1 <ENTER>
440 PRINT"OTHERWISE";:INPUT Z9$
450 IF Z9$="" THEN PRINT:PRINT"ANNUAL RATE OF RETURN IS ";1200*R;"%"
470 PRINT:INPUT"PRESS <ENTER> FOR MORE COMPUTATIONS";Z9$
475 IF Z9$ = "-1" THEN END
480 GOTO 100
