Related Articles: Hatch Your Nest Egg
Developer(s): David Draker
Date: 198x
Type: Program
Platform(s): TS 1000
Appears on
Assembled by Tim Ward from many sources. Contains programs 10122 – 10175.
Source Code
1 REM NEST EGG(SYNC JAN/FEB 84 PP 42-50) 2 LET C=0 3 LET D=0 4 LET E=0 5 LET F=0 6 LET G=0 7 LET H=0 8 LET I=0 9 LET J=0 10 LET K=0 11 LET L=0 12 LET M=0 13 LET N=0 14 LET S=0 15 LET W=0 16 LET X=0 17 LET Y=1 18 LET WA=0 19 LET WB=0 20 LET WC=0 21 LET WD=0 22 LET WE=0 23 LET XA=0 24 LET XB=0 25 LET XC=0 26 LET XD=0 27 LET XE=0 30 CLS 40 PRINT "ENTER INITIAL AMOUNT OF CAPITAL" 50 INPUT A 60 CLS 70 LET B$="YES" 80 PRINT "WILL THERE BE ANY YEARS IN WHICH YOU INTRODUCE NEW CPITAL?" 90 INPUT B$ 100 IF B$<>"YES" THEN GOTO 540 110 CLS 120 PRINT "HOW MANY YEARS WILL SEE NEW ADDITIONS OF CAPITAL?(MAXIMUM OF 5 YEARS)" 130 INPUT W 140 CLS 150 PRINT "FIRST ENTER THE YEAR NUMBER AT THE BEGINNING OF WHICH YOU WILL ADD NEW CAPITAL, AND THEN ENTER THE AMOUNT OF NEW CAPITAL" 160 INPUT WA 170 INPUT XA 180 CLS 190 LET S=S+1 200 IF S=W THEN GOTO 550 210 PRINT "YEAR ";WA;" NEW CAPITAL $";XA 220 PRINT 230 PRINT 240 PRINT "ENTER THE NEXT YEAR NUMBER AT THE BEGINNING OF WHICH YOU WILL ADD NEW CAPITAL, AND THEN ENTER THE AMOUNT OF NEW CAPITAL" 250 INPUT WB 260 INPUT XB 270 CLS 280 LET S=S+1 290 IF S=W THEN GOTO 550 300 PRINT "YEAR ";WB;" NEW CAPITAL $";XB 310 PRINT 320 PRINT 330 PRINT "ENTER THE NEXT YEAR AND THEN ENTER THE CAPITAL." 340 INPUT WC 350 INPUT XC 360 CLS 370 LET S=S+1 380 IF S=W THEN GOTO 550 390 PRINT "YEAR ";WC;" NEW CAPITAL $";XC 400 PRINT 420 PRINT "ENTER THE NEXT YEAR AND THEN ENTER THE NEW CAPITAL." 430 INPUT WD 440 INPUT XD 450 CLS 460 LET S=S+1 470 IF S=W THEN GOTO 550 480 PRINT "YEAR ";WD;" NEW CAPITAL $";XD 490 PRINT 500 PRINT 510 PRINT "ENTER THE NEXT YEAR AND THEN ENTER THE NEW CAPITAL." 520 INPUT WE 530 INPUT XE 540 CLS 550 PRINT "DO YOU WISH TO VARY THE INTEREST RATE OVER THE YEARS?" 560 INPUT B$ 570 CLS 580 IF B$<>"YES" THEN GOTO 1500 590 PRINT "WHAT INTEREST RATE DO YOU WANT FOR THE FIRST YEAR?" 600 INPUT F 610 PRINT 620 PRINT "WHAT INTEREST RATE FOR THE NEXT 2 YEARS?" 630 INPUT G 640 PRINT 650 PRINT "AND FOR THE SUBSEQUENT 3 YEARS?" 660 INPUT H 670 PRINT 680 PRINT "FINALLY, WHAT SINGLE INTEREST RATE FOR ALL REMAINING YEARS?" 690 INPUT I 700 CLS 710 PRINT "DO YOU WISH TO ACCUMULATE INTEREST FOR A NUMBER OF YEARS BEFORE YOU BEGIN TO WITHDRAW MONEY?" 720 INPUT B$ 730 CLS 740 IF B$<>"YES" THEN GOTO 780 750 PRINT "HOW MANY YEARS DO YOU WISH TO ACCUMULATE INTEREST WITHOUT WITHDRAWALS?" 760 INPUT J 770 CLS 780 PRINT "DO YOU WISH TO VARY THE RATE OF WITHDRAWALS OVER THE YEARS?" 790 INPUT B$ 800 CLS 810 IF B$<>"YES" THEN GOTO 2000 820 CLS 830 PRINT "HOW MUCH WILL YOU WITHDRAW MONTHLY IN THE FIRST 2 YEARS?" 840 PRINT 850 INPUT K 860 PRINT "HOW MUCH MONTHLY IN THE NEXT 3 YEARS?" 870 INPUT L 880 PRINT 890 PRINT "AND MONTHLY IN THE NEXT 5 YEARS?" 900 INPUT M 910 PRINT 920 PRINT "AND FINALLY, MONTHLY FOR ALL THE REMAINING YEARS?" 930 INPUT N 940 CLS 950 PRINT " BASED ON AN INITIAL CAPITAL OF $ ";A 960 PRINT 970 IF W>0 THEN PRINT " SOME NEW CAPITAL IN" 980 IF W>0 THEN PRINT W;" YEARS " 990 PRINT 1000 IF C>0 THEN PRINT " A CONSTANT INTEREST RATE OF ";C;" \' /\ ." 1010 IF F>0 THEN PRINT " A VARYING INTEREST RATE OF ";F;" \' /\ . IN THE FIRST YEAR" 1020 IF F>0 THEN PRINT G;" \' /\ . IN THE NEXT TWO YEARS" 1030 IF F>0 THEN PRINT H;" \' /\ . IN THE NEXT THREE YEARS" 1040 IF F>0 THEN PRINT I;" \' /\ . FOR REMAINING YEARS" 1050 PRINT 1060 IF J>0 THEN PRINT " INTEREST GROWTH FOR THE FIRST ";J;" YEARS" 1070 PRINT 1080 IF K>0 THEN PRINT " AND VARYING WITHDRAWALS OF $ ";K;" MONTHLY FOR TWO YEARS" 1090 IF K>0 THEN PRINT "$";L;" MONTHLY FOR THREE YEARS" 1100 IF K>0 THEN PRINT "$";M;" MONTHLY FOR FIVE YEARS" 1110 IF K>0 THEN PRINT "$";N;" MONTHLY FOR OTHER YEARS" 1120 IF K=0 THEN PRINT " AND CONSTANT MONTHLY WITHDRAWALS OF" 1130 IF K=0 THEN PRINT "$";D 1140 PRINT 1150 PRINT 1160 PRINT 1170 PRINT 1180 IF K>0 THEN GOSUB 3500 1190 IF D>0 THEN LET E=D 1200 IF J>=Y THEN LET E=0 1210 IF W>0 THEN GOSUB 2500 1220 IF F>0 THEN GOSUB 3000 1230 IF C>0 THEN LET Q=C 1240 LET A=INT (A*Q/100+A-12*E) 1250 PRINT "YEAR ";Y;" CAPITAL LEFT $ ";A 1260 LET Y=Y+1 1270 IF A>0 THEN GOTO 1180 1280 PRINT 1290 PRINT 1300 PRINT 1310 PRINT 1320 PRINT "THAT ENDS THE CALCULATIONS. WOULD YOU LIKE TO CHANGE ANY OF YOUR ESTIMATES?" 1330 INPUT B$ 1340 IF B$="YES" THEN GOTO 2 1350 PRINT 1360 PRINT 1370 PRINT "OK. THAT ENDS THE RUNNING OF THE PROGRAM. TRY IT AGAIN IF YOU HAVE MORE QUESTIONS." 1380 STOP 1500 PRINT "WHAT CONSTANT INTEREST RATE WOULD YOU LIKE TO USE?" 1510 INPUT C 1520 GOTO 700 2000 PRINT "WHAT CONSTANT AMOUNT DO YOU WISH TO WITHDRAW EVERY MONTH?" 2010 INPUT D 2020 GOTO 940 2500 IF Y=WA THEN LET X=XA 2510 IF Y=WB THEN LET X=XB 2520 IF Y=WC THEN LET X=XC 2530 IF Y=WD THEN LET X=XD 2540 IF Y=WE THEN LET X=XE 2550 IF Y=WA OR Y=WB OR Y=WC OR Y=WD OR Y=WE THEN LET A=A+X 2560 RETURN 3000 IF Y=1 THEN LET Q=F 3010 IF Y=2 OR Y=3 THEN LET Q=G 3020 IF Y=4 OR Y=5 OR Y=6 THEN LET Q=H 3030 IF Y>6 THEN LET Q=I 3040 RETURN 3500 IF Y=1+J OR Y=2+J THEN LET E=K 3510 IF Y=3+J OR Y=4+J OR Y=5+J THEN LET E=L 3520 IF Y=6+J OR Y=7+J OR Y=8+J OR Y=9+J OR Y=10+J THEN LET E=M 3530 IF Y>10+J THEN LET E=N 3540 RETURN 4000 SAVE "1014%3" 4010 RUN