What percentage return do your investments earn? If you play the stock market or own mutual funds, you may not know the rate of return from multiple investments. This program computes compounded annual rates of return on single investments and monthly annuities. RETURN calculates up to 20 single and four annuity investments, which you can make at different times.
RETURN works by calculating a figure based on a trial rate of return. It then compares this number with your investment’s current value. If the difference is greater than 0.1%, the computer picks another trial rate and repeats the computation. This iterative process (repeated adjusted trials until arriving at the correct response) is a perfect time-saving application for computers.
Type in the program and RUN. For your first entry, don’t re-evaluate loaded data (previous entries) when asked. Hit N for No and the program asks you for the month, date, year and amount of your first single investment. Hit 0 then ENTER to exit this data input section when desired. After you exit the single investment section, the program asks for monthly annuities. After you ENTER information on these, hit 0 then ENTER. The screen then blanks as the computer calculates. Be patient, and you will see your rate of return and ending balance displayed (the margin of error). An ending balance of $1 on a $1000 investment means your investment may actually fall between $999 or $1001.
Press Y when asked if you want to SAVE the data to tape. Then, you can recalculate your return rate later with a new monetary value of your investments. The program self-runs after you SAVE your data. You cannot enter more info if you SAVE and recalculate existing data.
Hit N if you don’t want to SAVE your data, generating report code 9 (STOP). Press RUN to start another round of investments.
If you want to enter more than 20 single investments, change the number 20 in lines 1240 and 1320 to the number desired. To enter more than four annuities, change the first numeral four in line 1250 to the number of annuities desired, and change the numeral four in line 1530 to the same quantity.
Program limitations: calculations stop if the rate of return is less than 1%. The program computes only gains, not losses. Computation time can take awhile, partly because the program accurately calculates the number of days between two dates (lines 30-150, 300-420, 510-630) for more exact results.
To achieve a greater accuracy than 0.1%, first convert the desired accuracy to a fraction. For example, represent 0.05% accuracy with the fraction 5/10,000. Then multiply this fraction by the term in line 690. The line reads as follows, with changes highlighted:
690 IF ABS (C(4)-Y)<**5**C(4)/10,000.
10 REM RETURN ON INVESTMENT
20 REM R.CRUM MAY 8,1983
30 DIM N(12)
40 LET N(1)=0
50 LET N(2)=31
60 LET N(3)=59
70 LET N(4)=90
80 LET N(5)=120
90 LET N(6)=151
100 LET N(7)=181
110 LET N(8)=212
120 LET N(9)=243
130 LET N(10)=273
140 LET N(11)=304
150 LET N(12)=334
160 GOTO 1070
170 LET Y=0
171 LET FLAG1=0
172 LET FLAG2=0
180 FAST
190 GOTO 260
200 REM SINGLE SUM VALUE
210 LET Z=L*(1+A)**K
220 RETURN
230 REM ANNUITY VALUE
240 LET Z=L*(((1+A)**K-1)/A)
250 RETURN
260 REM SINGLE INVESTMENTS
270 IF B=0 THEN GOTO 480
280 FOR I=1 TO B
290 LET K=0
300 FOR X=A(I,3) TO C(3)-1
310 LET K=K+365
320 IF INT (X/100)*100=X AND INT (X/400)*400<X THEN GOTO 340
330 IF INT (X/4)*4=X THEN LET K=K+1
340 NEXT X
350 IF A(I,3)=C(3) THEN LET K=365-K
360 IF INT (A(I,3)/100)*100=A(I,3) AND INT (A(I,3)/400)*400<A(I,3) THEN GOTO 380
370 IF INT (A(I,3)/4)*4=A(I,3) AND A(I,1)>2 THEN LET K=K-1
380 IF INT (C(3)/100)*100=C(3) AND INT (C(3)/400)*400<C(3) THEN GOTO 400
390 IF INT (C(3)/4)*4=C(3) AND C(1)>2 THEN LET K=K+1
400 LET K=K-N(A(I,1))-A(I,2)
410 LET K=K+N(C(1))+C(2)
420 IF A(I,3)=C(3) THEN LET K=K-365
430 LET L=A(I,4)
440 GOSUB 200
450 LET Y=Y+Z
460 NEXT I
470 REM ANNUITY INVESTMENTS
480 IF C=0 THEN GOTO 680
490 FOR I=1 TO C
500 LET K=0
510 FOR X=B(I,3) TO C(3)-1
520 LET K=K+365
530 IF INT (X/100)*100=X AND INT (X/400)*400<X THEN GOTO 550
540 IF INT (X/4)*4=X THEN LET K=K+1
550 NEXT X
560 IF B(I,3)=C(3) THEN LET K=365-K
570 IF INT (B(I,3)/100)*100=B(I,3) AND INT (B(I,3)/400)*400<B(I,3) THEN GOTO 590
580 IF INT (B(I,3)/4)*4=B(I,3) AND B(I,1)>2 THEN LET K=K-1
590 IF INT (C(3)/100)*100=C(3) AND INT (C(3)/400)*400<C(3) THEN GOTO 610
600 IF INT (C(3)/4)*4=C(3) AND C(1)>2 THEN LET K=K+1
610 LET K=K-N(B(I,1))-B(I,2)
620 LET K=K+N(C(1))+C(2)
630 IF B(I,3)=C(3) THEN LET K=K-365
640 LET L=B(I,4)
650 GOSUB 230
660 LET Y=Y+Z
670 NEXT I
680 REM CHECK BALANCE
690 IF ABS (C(4)-Y)<C(4)/1000 THEN GOTO 890
700 IF FLAG1 THEN GOTO 760
710 LET R=A
720 LET A=((A+A/2) AND (C(4)>Y))+((A-A/2) AND (C(4)<Y))
730 LET FLAG1=1
740 LET V=Y
750 GOTO 830
760 IF FLAG2 THEN GOTO 810
770 IF SGN (C(4)-V)=SGN (C(4)-Y) THEN GOTO 710
780 LET A=A+(A-R)*(ABS (V-C(4))/ABS (Y-V))
790 LET FLAG2=1
800 GOTO 830
810 LET A=(A+A*((C(4)-Y)/C(4)) AND (A+A*((C(4)-Y)/C(4))>=A/2))+(A/2 AND (A+A*((C(4)-Y)/C(4))<A/2))
820 IF A<.0000273 THEN GOTO 860
830 LET Y=0
840 GOTO 260
850 REM END
860 SLOW
870 PRINT "RATE OF RETURN <1 PER CENT"
880 GOTO 940
890 SLOW
900 PRINT "RATE OF RETURN ON INVESTMENT IS"
910 PRINT INT (((A*36500)+.5/1E2)*1E2)/1E2;" PER CENT"
920 PRINT "ENDING BALANCE AT THIS RATE IS"
930 PRINT "$";INT (((C(4)-Y)+.5/1E2)*1E2)/1E2
940 PRINT
950 PRINT "ANY MORE CALCULATIONS?(Y OR N)"
960 INPUT R$
970 IF R$="Y" THEN GOTO 1240
980 PRINT "WANT TO SAVE DATA?(Y OR N)"
990 INPUT R$
1000 IF R$="N" THEN STOP
1010 CLS
1020 PRINT "PREPARE TAPE RECORDER"
1030 PRINT "PRESS ""CONT"" TO SAVE"
1040 PAUSE 4E4
1050 SAVE "RETURN"
1060 GOTO 30
1070 LET A$="THIS PROGRAM COMPUTES RETURN ON INVESTMENT. UP TO 20 SINGLE SUM INVESTMENTS AND UP TO 4 MONTHLY INVESTMENTS (SUMS AND DATES) MAY BE PUT IN. YOU MUST ALSO PROVIDE THE CURRENT VALUE OF THE INVESTMENTS. THE PROGRAM MAY BE SAVED WITH THE DATA AND LATER RE-CALCULATED WITH A NEW CURRENT VALUE. MONTHLY INVESTMENTS ARE ASSUMED TO CONTINUE TO THE CURRENT DATE. PRESS ""0"" AND ""ENTER"" TO EXIT A SECTION OF DATA INPUT"
1080 FOR I=32 TO LEN A$ STEP 32
1090 FOR J=0 TO 32
1100 IF A$(I-J)=CHR$ 0 THEN GOTO 1120
1110 NEXT J
1120 PRINT A$((I-31) TO (I-J))
1130 LET I=I-J
1140 IF (I+32)>LEN A$ THEN GOTO 1160
1150 NEXT I
1160 PRINT A$((I+1) TO )
1170 PRINT
1180 PRINT "PRESS ""CONT"" TO CONTINUE"
1190 PAUSE 4E4
1200 CLS
1210 PRINT "WANT TO RE-EVALUATE LOADED DATA?(Y OR N)"
1220 INPUT R$
1230 IF R$="Y" THEN GOTO 1750
1240 DIM A(20,4)
1250 DIM B(4,4)
1260 DIM C(4)
1270 LET B=0
1280 LET C=0
1290 LET A(1,3)=3000
1300 LET B(1,3)=3000
1310 REM INPUT
1320 FOR I=1 TO 20
1330 CLS
1340 PRINT "SINGLE INVEST NO. ";I
1350 PRINT "MONTH? (2 DIGITS)"
1360 INPUT A(I,1)
1370 PRINT A(I,1)
1380 IF A(I,1)=0 THEN GOTO 1530
1390 PRINT "SINGLE INVEST NO. ";I
1400 PRINT " DAY?(2 DIGITS)"
1410 INPUT A(I,2)
1420 PRINT A(I,2)
1430 PRINT "SINGLE INVEST NO. ";I
1440 PRINT " YEAR?(4 DIGITS)"
1450 INPUT A(I,3)
1460 PRINT A(I,3)
1470 PRINT "SINGLE INVEST NO ";I;" AMOUNT"
1480 INPUT A(I,4)
1490 PRINT A(I,4)
1500 PAUSE 200
1510 LET B=I
1520 NEXT I
1530 FOR I=1 TO 4
1540 CLS
1550 PRINT "MO. INV. NO.";I
1560 PRINT " MONTH BEGIN (2 DIGITS)"
1570 INPUT B(I,1)
1580 PRINT B(I,1)
1590 IF B(I,1)=0 THEN GOTO 1750
1600 PRINT "MO. INV. NO.";I
1610 PRINT "DAY?(2 DIGITS)"
1620 INPUT B(I,2)
1630 PRINT B(I,2)
1640 PRINT "MO. INV. NO.";I
1650 PRINT " YEAR BEGIN (4 DIGITS)"
1660 INPUT B(I,3)
1670 PRINT B(I,3)
1680 PRINT "MO. INV. NO. ";I;" AMT"
1690 INPUT B(I,4)
1700 PRINT B(I,4)
1710 LET B(I,4)=(B(I,4)*12)/365
1720 PAUSE 200
1730 LET C=I
1740 NEXT I
1750 CLS
1760 PRINT "CURRENT MONTH?(2 DIGITS)"
1770 INPUT C(1)
1780 PRINT C(1)
1790 PRINT "CURRENT DAY?(2 DIGITS)"
1800 INPUT C(2)
1810 PRINT C(2)
1820 PRINT "CURRENT YEAR?(4 DIGITS)"
1830 INPUT C(3)
1840 PRINT C(3)
1850 PRINT "CURRENT VALUE OF INVESTMENTS?"
1860 INPUT C(4)
1870 PRINT C(4)
1880 LET A=.000263
1890 PAUSE 200
1900 CLS
1910 GOTO 170
SYNTACTIC SUM: 45026, 8K ROM
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.