home *** CD-ROM | disk | FTP | other *** search
- 10 rem copyright 1989 compute! publications, inc. - all rights reserved
- 20 printchr$(147);chr$(14);chr$(8):poke53281,0:poke53280,11:poke646,13
- 30 printspc(12)"[195]opyright 1989":print spc(6)"[195][207][205][208][213][212][197]! [208]ublications, [201]nc."
- 40 print spc(10)"[193]ll rights reserved."
- 50 sa=52224:if peek(sa)=169 and peek(sa+206)=96 then clr:goto250
- 60 h1=int((sa+13)/256):l1=(sa+13)-h1*256
- 70 h2=int((sa+150)/256):l2=(sa+150)-h2*256:cs=0
- 80 for ad=satosa+206:readml:cs=cs+ml:pokead,ml:next
- 90 if cs<>23175 then print chr$(147)"error in ml data":end
- 100 poke sa+5,l1:poke sa+9,h1:poke sa+133,l2:poke sa+138,h2
- 110 sys sa:clr
- 120 data 169,76,133,124,169,13,133,125,169,192,133,126,96,141,255,3
- 130 data 104,141,252,3,104,141,253,3,72,173,252,3,72,201,217,208
- 140 data 7,173,253,3,201,183,240,11,173,255,3,201,58,176,3,76
- 150 data 128,0,96,104,169,220,72,186,142,254,3,165,113,141,248,3
- 160 data 165,114,141,249,3,162,79,189,0,2,157,167,3,202,16,247
- 170 data 56,165,36,229,122,168,162,23,201,81,176,73,169,0,141,13
- 180 data 3,153,0,2,136,177,122,153,0,2,136,16,248,169,0,133
- 190 data 122,169,2,133,123,32,121,165,173,0,3,141,250,3,173,1
- 200 data 3,141,251,3,169,150,141,0,3,169,192,141,1,3,32,115
- 210 data 0,32,138,173,162,0,173,250,3,141,0,3,173,251,3,141
- 220 data 1,3,173,13,3,138,141,13,3,240,6,169,0,133,97,133
- 230 data 102,173,248,3,133,113,173,249,3,133,114,162,79,189,167,3
- 240 data 157,0,2,202,16,247,169,0,133,13,174,254,3,154,96,0
- 250 dn$="":lt$="":sp$=" ":dc$=dn$:hd$="":hr$=hd$+"":h$="":r$=""
- 260 cd$="[147]":c2$=cd$+dc$:u$="[145]":u3$=u$+u$+u$:er$=" "+r$+"error"
- 270 for i=1 to 6:dn$=dn$+dn$:lt$=lt$+lt$:sp$=sp$+sp$:next
- 280 dn$=left$(dn$,24):lt$=left$(lt$,40):sp$=left$(sp$,39)
- 290 dim c%(255),fc$(22),fc%(22),fv(22),v2(22),zf(22):printchr$(14)
- 300 dim cf(50),cp(50),cw(50),a(50),w(50),p(50),q(50),i2(50),w2(50),tp(39)
- 310 poke 784,108:poke785,122:poke786,0
- 320 def fn rs(ln)=usr(ln)+pos(" [184] [163][168][168][198]_[165]_l'[168]")
- 330 t=fn rs(360)
- 340 for k=1 to 12:read a:c%(a)=k:next
- 350 for k=49 to 58:c%(k)=10:next:c%(17)=5:c%(32)=7
- 360 data 67,95,133,134,13,145,147,20,46,48,89,78
- 370 poke 784,108:poke785,122:poke786,0
- 380 def fn r2(rr)=int(an/rr+.5)*rr
- 390 def fn rd(rr)=int(rr*100+.5)/100
- 400 printcd$
- 410 printhd$;dc$"[198]inancial [208]lanner";dc$:print"[208]ress # of option";dc$
- 420 print"1. [195]ollege planning"
- 430 print"2. [195]ar buy/lease"
- 440 print"3. [195]ompound interest/savings"
- 450 print"4. [204]oan payments"
- 460 print"5. [198]ixed/adjustable rate mortgage"
- 470 print"6. [200]ow much life insurance do you need?"
- 480 print"7. [211]hould you refinance your mortgage?"
- 490 print"8. [201][210][193][160]planning":af=0
- 500 geta$:if a$="" then500
- 510 c=c%(asc(a$)):if c=1 then gosub930:goto410
- 520 if c=2 then printchr$(147):end
- 530 if c<>10 then400
- 540 printdc$;r$"[210]eading data statements ..."
- 550 on val(a$) goto2000,3000,4000,5000,6000,7000,8000,9000
- 560 goto400
- 570 rem--
- 580 for i=0 to nr:printfc$(i);:gosub820:next:return
- 590 rem print screen subroutine
- 600 rr=1104:px=0:py=0:my=22:for ty=22 to 10 step-1
- 610 if peek(rr+ty*40)<>32 or peek(rr+ty*40+1)<>32 then my=ty:ty=10
- 620 next:gosub1940:gosub720:if t<0 then710
- 630 printhr$"[208][210][201][206][212][201][206][199] ...":open7,4,7
- 640 for i=0 to my:t$=dc$:h=-2
- 650 for j=0 to 39:a=peek(rr+i*40+j) and 127:if a=96 then a=32:goto690
- 660 if a>0 and a<27 then a=a+64:goto680
- 670 if a>64 and a<91 then a=a+128
- 680 if a<>32 then h=j
- 690 t$=t$+chr$(a):next
- 700 t$=left$(t$,h+2):print#7,t$:next:close7
- 710 gosub1950:return
- 720 open7,4,7:close7:t=st
- 730 open7,4:if st=t then close7:return
- 740 printhd$sp$:printu$"[208]rinter not ready, press _ to cancel"
- 750 geta$:if a$="_" then t=-1:close7:return
- 760 if a$="" then t=t+1:if t<9 then750
- 770 t=0:printhd$;sp$:close7:goto720
- 780 gosub1070:if qa=2 then return
- 790 t$=t2$
- 800 printh$;left$(dn$,cy+2);fc$(cy);tab(lc-9);left$(sp$,9)
- 810 printh$;left$(dn$,cy+2);fc$(cy);:i=cy
- 820 if fc%(i)=0 then print:return
- 830 on fc%(i) gosub850,880,890,910
- 840 print tab(lc-len(t$)-(1=fc%(i)));t$:return
- 850 if sf=0 then t$=mid$(str$(fv(i)),2,6)+"%":return
- 860 t$=t2$+"%":if t2$="" then t$="0%"
- 870 return
- 880 t$="$"+mid$(str$(int(fv(i)+.5)),2):return
- 890 t$="no":if fv(i) then t$="yes"
- 900 return
- 910 t$=mid$(str$(int(fv(i))),2):return
- 920 rem calculator subroutine
- 930 printh$;sp$
- 940 t=0:a2$="":t$=hd$+sp$+"[145]":printt$:if cc$<>"" then a2$=str$(val(cc$))
- 950 printt$:for t2=0 to t:next:print"?"a2$
- 960 geta$:if a$<>"" then990
- 970 t=t+1:if t>199 then t=0:goto950
- 980 goto960
- 990 t=0:a=asc(a$):if a=13 then cc$=a2$:goto930
- 1000 if(a>38 and a<58 and a<>44) or a=94 then a2$=left$(a2$+a$,38):goto950
- 1010 if a=95 or a=67 then printh$;sp$:printsp$:return
- 1020 if a=20 then if len(a2$) then a2$=left$(a2$,len(a2$)-1):goto950
- 1030 if a=147 or a=19 then a2$="":goto950
- 1040 if a<>81 and a<>69 and a<>61 then960
- 1050 print t$;h$;sp$:if len(cc$)<21 then printh$;cc$" =";
- 1060 printval(cc$):return
- 1070 if fc%(cy)<>0 then1100
- 1080 sf=0:gf=0:gosub1420:cy=cy+1:if cy>nr then cy=0
- 1090 goto1070
- 1100 if sf=0 then t2$=mid$(str$(fv(cy)),2):sf=1
- 1110 printh$;left$(dn$,cy+2);r$;:i=cy:gosub820:qa=3
- 1120 geta$:if a$="" then1120
- 1130 a=asc(a$)
- 1140 on c%(a) goto1160,1170,1180,1120,1190,1230,1270,1290,1370,1400,1330,1350
- 1150 goto1120
- 1160 gosub930:goto1120
- 1170 qa=1:return
- 1180 qa=2:gosub1770:return
- 1190 if a<>17 and a<>13 then1230
- 1200 gosub800:gf=0:gosub1420:cy=cy+1:sf=0:if cy>nr then cy=0
- 1210 if fc%(cy)=0 then1200
- 1220 return
- 1230 gosub800
- 1240 gf=0:gosub1420:cy=cy-1:sf=0:if cy<0 then cy=nr
- 1250 if fc%(cy)=0 then1240
- 1260 return
- 1270 if a=147 or (a=32 and fc%(cy)<>3) then t2$="":fv(cy)=0:return
- 1280 goto1320
- 1290 if len(t2$)<2 then t2$="":fv(cy)=0:return
- 1300 t2$=left$(t2$,len(t2$)-1):fv(cy)=val(t2$):return
- 1310 rem
- 1320 fv(cy)=1-fv(cy):return
- 1330 if fc%(cy)=3 then fv(cy)=1
- 1340 return
- 1350 if fc%(cy)=3 then fv(cy)=0
- 1360 return
- 1370 if fc%(cy)<>1 then return
- 1380 for j=1 to len(t2$):if mid$(t2$,j,1)=chr$(46) then j=7:next:return
- 1390 next j
- 1400 if gf=0 then gf=1:t2$=a$:fv(cy)=val(t2$):return
- 1410 t2$=left$(t2$+a$,7):fv(cy)=val(t2$):return
- 1420 if fc%(cy)=0 then return
- 1430 if fc%(cy)<>1 then1500
- 1440 t$=hd$+sp$+hd$+"[215][193][210][206][201][206][199] - % rate "
- 1450 if fv(cy)>100 then printt$;"greater than 100":return
- 1460 if fv(cy)=0 then printt$;"is zero":return
- 1470 if v2(cy)>0 and fv(cy)>v2(cy)*2+4 then printt$;"very high":return
- 1480 if v2(cy)>0 and fv(cy)<.1 then printt$"very low":return
- 1490 goto1540
- 1500 if fc%(cy)<>4 then1540
- 1510 t$=hd$+sp$+hd$+"[215][193][210][206][201][206][199] - # is[160]"
- 1520 if fv(cy)=0 thenprintt$;"zero":return
- 1530 if v2(cy)>0 and fv(cy)>v2(cy) thenprintt$;"extremely large":return
- 1540 printhd$;sp$:return
- 1550 if qt=zt then return
- 1560 qt=zt:t=fn rs(zt):i=0
- 1570 zf(i)=0:read fc$(i):if fc$(i)="e" then nr=i-1:return
- 1580 if fc$(i)<>"ir" then1600
- 1590 fc$(i)="[201]nflation rate":fc%(i)=1:fv(i)=4.4:v2(i)=5:goto1630
- 1600 v2(i)=-1:read fc%(i):if fc%(i) then read fv(i):v2(i)=fv(i)
- 1610 if fc%(i)=4 or fc%(i)=1 then read zf(i)
- 1620 if fc%(i)=4 then read v2(i)
- 1630 i=i+1:goto1570
- 1640 r4=12:goto1660
- 1650 r4=7
- 1660 t$="$"+mid$(str$(int(rr+.5)),2):printleft$(sp$,r4-len(t$));t$;:return
- 1670 print"$"mid$(str$(int(rr+.5)),2);:return
- 1680 an$="$"+mid$(str$(an),2)
- 1690 if an=int(an) then an$=an$+".00":return
- 1700 if abs(an*10-int(an*10+.5))<.001 then an$=an$+"0"
- 1710 return
- 1720 print:print"[195]hange any or all values, then move"
- 1730 print"cursor to the number you want"
- 1740 print"calculated and press f1."
- 1750 cy=2:sf=0:return
- 1760 an=fn rd(an):gosub1680:printleft$(sp$,11-len(an$));an$;:return
- 1770 printh$;left$(dn$,nr+4);:for rr=nr+4 to 23:printsp$:next
- 1780 print h$;left$(dn$,nr+4):if af=1 then fv(cy)=.01
- 1790 for k=2 to nr:if zf(k)=0 or fv(k)>00 then1820
- 1800 printfc$(k)" = 0";er$:k=nr:qa=3
- 1810 print" [195]hange value then f1 calc, _ menu"
- 1820 next:if qa=3 then return
- 1830 print h$;left$(dn$,nr+4);r$"calculating..."u$:sf=0:return
- 1840 print:print"[197]nter all values then press f1 to calc":cy=2:sf=0:return
- 1850 printhr$u$"[208]ress f5 ";t$:pf=-1
- 1860 printhr$"[208]ress f1 another, f3 print, _ menu":gf=0
- 1870 geta$:if a$="" then1870
- 1880 a=asc(a$):if a=67 then gosub1940:gosub930:gosub1950:goto1870
- 1890 if pf<0 and a=135 then ra=4:goto1920
- 1900 if c%(a)>4 then1870
- 1910 ra=c%(a)-1:if ra<1 or ra>3 then1870
- 1920 if pf<0 then printh$;sp$:pf=0
- 1930 printhd$;sp$:return
- 1940 for k=0 to 39:tp(k)=peek(1064+k):next:return
- 1950 for k=0 to 39:poke 1064+k,tp(k):next:return
- 2000 rem--
- 2010 data "[195]ollege planning",0," ",0
- 2020 data "[212]oday's annual cost",2,11500
- 2030 data ir
- 2040 data "[217]ears until college",4,12,1,18
- 2050 data "# years in college",4,4,1,8," ",0
- 2060 data "[208]resent savings",2,8500
- 2070 data "[193]fter tax yield ",1,7.35,1
- 2080 data e
- 2090 zt=2000:lc=28:gosub1550
- 2100 printcd$:sf=0
- 2110 gosub580
- 2120 gosub1840
- 2130 gosub780
- 2140 on qa goto400,2150,2130
- 2150 if fv(4)=0 or fv(5)=0 then an=fv(cy):print"# years 0"+er$:goto2330
- 2160 t2=0:t3=0:t4=0:ri=1+(fv(8)-fv(3))/100:r3=1+fv(3)/100:r8=1+fv(8)/100
- 2170 for i=fv(4) to fv(4)+fv(5)-1
- 2180 t2=t2+fv(2)/ri^i
- 2190 t3=t3+r3^fv(4)/(ri^(i-fv(4)))
- 2200 t4=t4+r3^i*fv(2)
- 2210 next i:t3=t3*fv(2)-fv(7)*r8^fv(4)
- 2220 print"[212]otal college costs will be $";int(t4+.5):print
- 2230 if fv(8)=0 then an=t3/fv(4):goto2250
- 2240 an=t3*fv(8)/100/(r8^fv(4)-1)
- 2250 if an>0 then2280
- 2260 rr=fv(7)-t2:print"[211]avings exceed needs by ";:gosub1670
- 2270 print".":q2=0:goto2330
- 2280 print"[217]ou need to save $"fn r2(25)"every year"
- 2290 print"for the next";fv(4)"years":an=t2-fv(7)
- 2300 print"[207][210] set aside an additional $";fn r2(500)
- 2310 print"today to pay for college."
- 2320 an=an+fv(7):q2=fn r2(500)
- 2330 gosub1860:on ra goto400,2100
- 2340 gosub600:goto2330
- 3000 rem--
- 3010 data "[195]ar buy/lease",0
- 3020 data " ",0
- 3030 data ir," ",0
- 3040 data "--[194][213][217]--",0
- 3050 data "[208]rice of [195]ar",2,12500
- 3060 data " [198]inancing",3,1
- 3070 data " [212]rade in/down payment",2,2000
- 3080 data " [193]nnual % rate",1,12,1
- 3090 data " # of monthly payments",4,60,1,84,"--[204][197][193][211][197]--",0
- 3100 data " [210]efundable security dep",2,250
- 3110 data " [201]nitial payment",2,378
- 3120 data " [205]onthly payment",2,189
- 3130 data " # of payments",4,60,0,84
- 3140 data " [194]uy out price",2,6200
- 3150 data e
- 3160 zt=3000:lc=31:gosub1550
- 3170 printcd$:sf=0
- 3180 gosub580
- 3190 gosub1840
- 3200 print:print"[217]ears to months: 3/36, 4/48, 5/60"
- 3210 gosub780
- 3220 on qa goto400,3230,3210
- 3230 if fv(6)=0 then tc=fv(5):goto3280
- 3240 tc=fv(7):i=fv(8)/100:r2=(1+fv(2)/100)^(1/12):p=fv(5)-fv(7)
- 3250 ep=(i*p/12)/(1-1/(i/12+1)^(12*fv(9)/12))
- 3260 for j=1 to fv(9)
- 3270 tc=tc+ep/(r2^j):next
- 3280 t2=fv(12):ri=(1+fv(2)/100)^(1/12):t2=t2+fv(11)-fv(11)/ri^fv(14)
- 3290 for j=1 to fv(14)
- 3300 t2=t2+fv(13)/ri^j:next:t2=t2+fv(15)/ri^fv(14)
- 3310 print"[212]otal costs for buying: $";:if fv(6)=0 then printfv(5):goto3330
- 3320 print int(ep*fv(9)+fv(7)+.5)
- 3330 print spc(15)"leasing: $";int(fv(13)*fv(14)+fv(12)+fv(15)+.5)
- 3340 print"[210]eal costs, after inflation adjustment"
- 3350 print spc(16)"buying: $";int(tc+.5)
- 3360 print spc(15)"leasing: $";int(t2+.5)
- 3370 if fv(6)=0 then3390
- 3380 print" [205]onthly payments if financed: $";int(ep+.5);h$
- 3390 gosub1860:on ra goto400,3170
- 3400 gosub600:goto3390
- 4000 rem--
- 4010 data "[195]ompound interest/savings",0," ",0
- 4020 data "[208]resent value",2,2915
- 4030 data "[205]onthly addition",2,35
- 4040 data "[193]nnual yield",1,6.29,0
- 4050 data "# of years",4,9,0,49
- 4060 data "[198]uture value",2,10000
- 4070 data e
- 4080 zt=4000:lc=25:gosub1550
- 4090 printcd$:sf=0:af=1
- 4100 gosub580
- 4110 gosub1720
- 4120 gosub780
- 4130 on qa goto400,4140,4120
- 4140 pv=fv(2):r=fv(3):n=12:ri=(1+fv(4)/100)^(1/12):i=1-ri:y=fv(5):t=fv(6)
- 4150 ny=y*12:t2=pv*ri^ny:t=t-t2:rn=ri^ny:in=fv(4)/1200
- 4160 on cy-1 goto4170,4190,4250,4360,4420
- 4170 t4=0:for k=0 to y*12-1:t4=t4+r*ri^k:next
- 4180 an=(fv(6)-t4)/rn:an=int(an+.5):goto4440
- 4190 if ri=1 then an=(fv(6)-pv)/ny:goto4210
- 4200 t5=(fv(6)-pv*rn)*(ri-1)/(rn-1):an=t5
- 4210 an$=mid$(str$(int(an*100-int(an)*100)),2)
- 4220 if len(an$)=1 then an$="0"+an$
- 4230 an$="$"+str$(int(an))+"."+an$
- 4240 an=int(an+.5):goto4470
- 4250 an=10:da=4.95:g=0:a4=500
- 4260 if ny*r+pv<=0 then4450
- 4270 if fv(6)<ny*r+pv then4460
- 4280 ri=(1+an/100)^(1/12):rn=ri^ny:if a4>10 then a4=int(a4*.9)
- 4290 g2=pv*rn+r*(rn-1)/(ri-1):if int(g2*a4+.5)=fv(6)*a4 then4350
- 4300 if g2<fv(6) then4330
- 4310 an=an-da:if g=1 then da=da/2
- 4320 g=-1:goto4280
- 4330 an=an+da:if g=-1 then da=da/2
- 4340 g=1:goto4280
- 4350 an=fn r2(.001):an$=str$(an)+"%":goto4470
- 4360 if ny*r+pv<=0 then4450
- 4370 if fv(6)<ny*r+pv then4460
- 4380 if ri=1 then an=(fv(6)-pv)/r/12:goto4410
- 4390 z=ri-1:an=(fv(6)*z+r)/(z*pv+r)
- 4400 an=log(an)/log(ri):an=an/12
- 4410 an=fn r2(.1):an$=str$(an)+" years":goto4470
- 4420 if ri=1 then an=pv+r*ny:goto4440
- 4430 an=pv*rn+r*(rn-1)/(ri-1)
- 4440 an=int(an+.5):an$="$"+str$(an):goto4470
- 4450 an=fv(cy):an$="$ value 0"+er$:goto4470
- 4460 an=fv(cy):an$="negative result"+er$
- 4470 fv(cy)=an:gosub800
- 4480 printh$;left$(dn$,nr+3)
- 4490 printsp$:printsp$:printsp$:printsp$
- 4500 printu3$" calculated "fc$(cy):print" is :"an$
- 4510 gosub1860:on ra goto400,4090
- 4520 gosub600:goto4510
- 5000 rem--
- 5010 data "[204]oan payments",0," ",0
- 5020 data "[193]mount of loan",2,21003
- 5030 data "[201]nterest rate",1,11.89,0
- 5040 data "# of monthly payments",4,120,1,600
- 5050 data "[205]onthly payment",2,300
- 5060 data e
- 5070 zt=5000:lc=30:gosub1550
- 5080 printcd$:sf=0:af=1
- 5090 gosub580
- 5100 gosub1720
- 5110 gosub780
- 5120 on qa goto400,5130,5110
- 5130 p=fv(2):r=fv(5):ri=(1+fv(3)/100)^(1/12):i=1-ri:ny=fv(4):n=12:rn=ri^ny
- 5140 i2=fv(3)/100:i3=i2/n+1
- 5150 if ny=0 and cy<>4 then t=4:goto5390
- 5160 if fv(5)=0 and cy<>5 then t=5:goto5390
- 5170 if fv(2)=0 and cy<>2 then t=2:goto5390
- 5180 if p>r*ny and cy=3 thenan=fv(cy):an$="negative result"+er$:goto5410
- 5190 on cy-1 goto5200,5230,5320,5360
- 5200 if i3=1 then an=r*ny:goto5220
- 5210 an=r*n*(1-1/i3^ny)/i2
- 5220 an=int(an+.5):an$="$"+str$(an):goto5410
- 5230 sf=0:an=10:da=4.95:g=0:if r*ny=p then an=0:goto5310
- 5240 i2=an/100:i3=i2/n+1
- 5250 g2=(i2*p/n)/(1-1/i3^ny):if int(g2*50+.5)=r*50 then5310
- 5260 if g2<r then5290
- 5270 an=an-da:if g=1 then da=da/2
- 5280 g=-1:goto5240
- 5290 an=an+da:if g=-1 then da=da/2
- 5300 g=1:goto5240
- 5310 an=fn r2(.001):an$=str$(an)+"%":goto5410
- 5320 if i3=1 then an=p/r:goto5350
- 5330 if r<p*i3-p then an$="[205]onthly payment too small"+er$:an=fv(cy):goto5410
- 5340 an=log(-1/(p*i2/r/n-1))/log(i3)
- 5350 an=int(an+.5):an$=str$(an):goto5410
- 5360 if i3=1 then an=p/ny:goto5380
- 5370 an=(i2*p/n)/(1-1/i3^ny)
- 5380 an=fn rd(an):gosub1680:goto5410
- 5390 an=fv(cy):an$=fc$(t)
- 5400 an$=an$+" = 0"+er$
- 5410 fv(cy)=an:gosub800
- 5420 printh$;left$(dn$,nr+3)
- 5430 printsp$:printsp$:printsp$:printsp$
- 5440 printu3$" calculated "fc$(cy):print" is :"an$
- 5450 print:t$="to print payment schedule"
- 5460 gosub1850:on ra goto400,5080,5470,5480
- 5470 gosub600:goto5450
- 5480 printcd$"[197]nter date of first payment (_ cancel)":input" month (1-12)";m$
- 5490 if m$="_" then5080
- 5500 m=int(val(m$)):if m<1 or m>12 then5480
- 5510 input" year";yr$:yr=int(val(yr$)):if yr>100 then yr=yr-int(yr/100)*100
- 5520 gosub720:if t<0 then5080
- 5530 print"printing payment schedule..."
- 5540 open4,4:cmd4
- 5550 an=fv(2):gosub1760:printdc$" borrowed at "fv(3)"%":an=fv(5)
- 5560 print:printdc$" # date principal interest balance due"
- 5570 p=fv(2):a=fv(5):ri=fv(3)/1200:if fv(4)=1 then5690
- 5580 for k=1 to fv(4)
- 5590 if k<100 then print" ";:if k<10 then print" ";
- 5600 printk;
- 5610 t$=dc$+str$(m)+"/":if yr<10 then t$=t$+"0"
- 5620 t$=t$+mid$(str$(yr),2):printleft$(sp$,7-len(t$));t$;
- 5630 m=m+1:if m>12 then m=1:yr=yr+1:if yr>99 then yr=0
- 5640 if k=fv(4) then next:goto5690
- 5650 t=p*ri:an=a-t:gosub1760
- 5660 an=t:gosub1760:print" ";
- 5670 p=p-a+t:an=p:gosub1760:print
- 5680 next
- 5690 t=p*ri:an=p:gosub1760
- 5700 an=t:gosub1760:an=0:gosub1760
- 5710 an=fv(5):print:printdc$" regular payments:";:gosub1760:print
- 5720 an=p+t:printdc$" last payment:";:gosub1760
- 5730 print#4:close4
- 5740 print"press f1, f3 to go back to loans, _ menu"
- 5750 gosub1870:on ra goto400,5080,5080
- 6000 rem--
- 6010 data "[198]ixed rate or adjustable rate mortgage",0," ",0
- 6020 data "[208]rincipal",2,86000
- 6030 data "[198]ixed rate mortgage",0
- 6040 data " [193]nnual % rate",1,10.86,1
- 6050 data " [208]oints",1,3,0
- 6060 data " # of years",4,30,1,40
- 6070 data "[193]djustable rate mortgage",0
- 6080 data " [201]nitial interest rate",1,8.93,1
- 6090 data " [208]oints",1,2,0
- 6100 data " [217]early cap",1,2,1
- 6110 data " [204]ifetime cap",1,14,1
- 6120 data " # of years",4,30,1,40
- 6130 data " ",0
- 6140 data ir
- 6150 data e
- 6160 zt=6000:lc=30:gosub1550
- 6170 printcd$:sf=0:gosub580
- 6180 gosub1840
- 6190 gosub780
- 6200 on qa goto400,6210,6190
- 6210 n=12:i2=fv(4)/100:i3=i2/n+1:ny=fv(6)*12:p=fv(2):y=fv(6):yy=fv(12)
- 6220 a2=(i2*p/n)/(1-1/i3^ny)
- 6230 i2=fv(8)/100:i3=i2/n+1:ny=fv(12)*12
- 6240 an=(i2*p/n)/(1-1/i3^ny):a(0)=an:w(0)=an
- 6250 mx=fv(11)/100:d=fv(10)/100:p(0)=p:q(0)=p:i2(0)=i2:w2(0)=i2
- 6260 cf(0)=fv(5)/100*p:cp(0)=fv(10)/100*p:cw(0)=cp(0):ny=yy*12
- 6270 y2=0:y4=0:ri=1+fv(14)/100
- 6280 for k=1 to 5:gosub6810:next
- 6290 rr=a2:print"[198]ixed rate payments are[160]";:gosub1670:print" a month."
- 6300 rr=an:print"[193][210][205][160]payments start at ";:gosub1670:print". [201]f rates"
- 6310 rr=a(2):print"rise .5% a year, payments become ";:gosub1670:print
- 6320 rr=a(5):print"in 2 years, and ";:gosub1670:print" in 5 years."
- 6330 rr=w(2):print"[201]n the worst case, payments are ";:gosub1670:print
- 6340 rr=w(5):print"in 2 years, and ";:gosub1670:print" in 5 years."
- 6350 t$="for further analysis"
- 6360 gosub1850:on ra goto400,6170,6370,6380
- 6370 gosub600:goto6350
- 6380 if y<6 then6410
- 6390 ty=y-1:if yy>y then ty=yy-1
- 6400 gosub1770:for k=6 to ty+1:gosub6810:next
- 6410 printcd$;dc$"[193]djustable rate mortgages are great"
- 6420 print"if interest rates go down, and terrible"
- 6430 print"when rates skyrocket. [193][210][205]s are also"
- 6440 print"good for people who move often."
- 6450 ifyy<>ythenprint"[195]omparisons invalid because lengths differ.":goto6570
- 6460 if y2>0 then6490
- 6470 print"[212]he fixed rate mortgage is superior. [212]he";
- 6480 print"[193][210][205] makes sense if rates go down.":goto6570
- 6490 print"[201]f interest rates increase .5% a year"
- 6500 print"(a realistic and pessimistic scenario)"
- 6510 print"and you sell within"y2"years the [193][210][205]":print"is better.";
- 6520 if y4=0 then6570
- 6530 print" [201]f rates rise quickly (up"
- 6540 print"yearly cap every year), you still"
- 6550 print"come out ahead if sell within"y4
- 6560 print"years."
- 6570 print:t$="to print cost analysis table"
- 6580 gosub1850:on ra goto400,6170,6590,6610
- 6590 gosub600:goto6570
- 6600 if a=95 then6170
- 6610 gosub720:if t=-1 then6170
- 6620 open4,4,7:cmd4
- 6630 rr=a2:printdc$"[198]ixed rate payments are ";:gosub1670:print
- 6640 if fv(6)=fv(12) then6660
- 6650 printdc$"[215][193][210][206][201][206][199]! cost comparison invalid because of term difference."
- 6660 print:printdc$"[195]umulative real costs and monthly payments":print
- 6670 printdc$"[217]r [198]ixed [210]ising rates [215]orst case"
- 6680 printdc$" costs costs payment costs payment"
- 6690 for k=0 to ty
- 6700 printdc$;mid$(str$(k),2);
- 6710 if k<10 then print"[160]";
- 6720 rr=cf(k):gosub1640:rr=cp(k):gosub1640:rr=a(k):gosub1650
- 6730 rr=cw(k):gosub1640:rr=w(k):gosub1650:print:next:if y<>yy then6780
- 6740 print:printdc$"[207]ver the life of the"y"year mortgage the real costs are:"
- 6750 rr=cf(ty+1):gosub1640:printdc$" for the fixed rate mortgage"
- 6760 rr=cp(ty+1):gosub1640:printdc$" for the [193][210][205] with rising interest rates"
- 6770 rr=cw(ty+1):gosub1640:printdc$" for the worst case [193][210][205]"
- 6780 print#4:close4:printchr$(147)hr$"[208]ress f1, f3 another, _ menu":gosub1870
- 6790 if a=95 then400
- 6800 goto6170
- 6810 t=k-1:n4=ny-k*n
- 6820 h=n/ri^t:cf(k)=cf(t)+a2*h:cp(k)=cp(t)+a(t)*h:cw(k)=cw(t)+w(t)*h
- 6830 if cf(k)>cp(k) then y2=k
- 6840 if cf(k)>cw(k) then y4=k
- 6850 i2=i2(t)/12:w2=w2(t)/12:p=p(t):q=q(t):a=a(t):w=w(t)
- 6860 for j=1 to n
- 6870 p=p+p*i2-a:q=q+q*w2-w
- 6880 next j:q(k)=q:p(k)=p
- 6890 i2(k)=i2(t)+.005:if i2(k)>mx then i2(k)=mx
- 6900 w2(k)=w2(t)+d:if w2(k)>mx then w2(k)=mx
- 6910 if n4=0 then a(k)=0:w(k)=0:p(k)=0:q(k)=0:goto6950
- 6920 if k>y then cf(k)=cf(t)
- 6930 a(k)=(i2(k)*p(k)/n)/(1-1/(i2(k)/n+1)^n4)
- 6940 w(k)=(w2(k)*q(k)/n)/(1-1/(w2(k)/n+1)^n4)
- 6950 return
- 7000 rem--
- 7010 data "[204]ife insurance needs",0," ",0
- 7020 data "[212]otal household salary income",2,43000
- 7030 data "[217]our salary, before taxes",2,25000
- 7040 data "[193]nnual savings",2,2000
- 7050 data "[217]our age",4,42,0,99
- 7060 data "# of people in household",4,4,0,10
- 7070 data "[193]ge of youngest person",4,6,0,99
- 7080 data " ",0
- 7090 data "[195]ash, savings/checking acct.",2,1200
- 7100 data "[211]tocks, mutual funds",2,5000
- 7110 data "[200]ard asset investments",2,0
- 7120 data " ",0,"[200]ome mortgage",2,50000
- 7130 data "[195]ar loan",2,5000
- 7140 data "[195]onsumer debt",2,500
- 7150 data "[195]ollege fund",2,65000
- 7160 data "[195]haritable contributions",2,1000
- 7170 data "[195]urrent interest rate",1,9.35,0
- 7180 data e
- 7190 zt=7000:lc=38:gosub1550:if q2>0 then fv(16)=q2
- 7200 printcd$:sf=0
- 7210 gosub580
- 7220 gosub1840
- 7230 gosub780
- 7240 on qa goto400,7250,7230
- 7250 if fv(2)<fv(3) then printfc$(2)" [204][197][211][211][160][212][200][193][206]":printfc$(3);er$:goto7520
- 7260 fe=.6*fv(3):if fe<6000 then fe=6000
- 7270 ca=fv(9)+fv(10)*.9+fv(11)*.8:cd=fv(13)+fv(14)+fv(15)+fv(16)
- 7280 if fv(6)<2 then an=fe-ca+cd:goto7400
- 7290 re=fv(3)-fv(2)/(fv(6)+.5)-fv(4)*fv(3)/fv(2):i=fv(18)+1:if i<2.5 then i=2.5
- 7300 r2=re*2:if fv(3)<4000 or fv(5)<25 or fv(6)<2 or fv(7)>18 then7330
- 7310 t4=fv(3):if t4>37000 then t4=37000
- 7320 re=re-4000-(fv(6)>3)*1400-t4/15
- 7330 ip=re/i*100+r2:if ip<0 then ip=0:goto7360
- 7340 if fv(7)<10 then ip=ip*(1+(10-fv(7))/33)
- 7350 if fv(7)>12 and fv(7)<21 then ip=ip*(1-(fv(7)-12)/33)
- 7360 t=fv(3)/(fv(2)+1)
- 7370 an=ip+fe-ca*t+cd*sqr(t)+fv(17):if fv(6)>2and ip<1then an=an+(fv(6)-2)*2500
- 7380 if an>100000 then an=fn r2(5000):goto7410
- 7390 if an>50000 then an=fn r2(2500):goto7410
- 7400 an=fn r2(1000)
- 7410 printsp$:printsp$:printu3$
- 7420 if an<1000 then print"[217]ou may not need any life insurance.":goto7520
- 7430 print"[217]ou should have about $";str$(an)
- 7440 print"in life insurance coverage. [204]ook into"
- 7450 t$="universal life":a=fv(5):t=an/fv(2)
- 7460 if t>10 or (t>8 and an>30) or (t>6 and a>35) then t$="term life":goto7490
- 7470 t=fv(2)/fv(4):if t<5 or (t<6 and a<35) then t$="term life":goto7490
- 7480 if a<35 or (a<55 and fv(4)<1000) then t$="term life or universal life"
- 7490 if fv(3)>75000 and fv(4)<fv(2)/50 and ca<fv(3) then t$="whole life"
- 7500 if fv(4)<fv(2)/25 and fv(5)>45 and ca<fv(2) then t$="whole life"
- 7510 print"a "t$" policy."h$
- 7520 gosub1860:on ra goto400,7200
- 7530 gosub600:goto7520
- 8000 rem--
- 8010 data "[210]efinancing a mortgage",0," ",0
- 8020 data "[195]urrent financing",0
- 8030 data " [195]urrent balance",2,65000
- 8040 data " [193]nnual % rate",1,12.5,1
- 8050 data " # payments due",4,300,1,480
- 8060 data " ",0,"[211]uggested refinancing",0
- 8070 data " [208]rincipal",2,65000
- 8080 data " [193]nnual % rate",1,10.86,1
- 8090 data " # payments",4,360,1,600
- 8100 data " [208]oints",1,3,0
- 8110 data " [207]ther closing costs",2,2500
- 8120 data " [208]repayment penalty",2,0
- 8130 data "[212]ax bracket",1,28,0
- 8140 data "[201]nterest and points deductible",3,1
- 8150 data ir
- 8160 data e
- 8170 zt=8000:lc=37:gosub1550
- 8180 printcd$:sf=0:gosub580
- 8190 gosub1840
- 8200 gosub780
- 8210 on qa goto400,8220,8200
- 8220 p=fv(3):q=fv(8):i2=fv(4)/100:w2=fv(9)/100:d=1-fv(15)*fv(14)/10000
- 8230 ny=fv(5):n4=fv(10):ps=p:n=12
- 8240 pt=(fv(11)*d-fv(11))/n4
- 8250 cf=0:cw=fv(13)+fv(12)+fv(11)
- 8260 ty=ny:if ty<n4 then ty=n4
- 8270 a=(i2*p/n)/(1-1/(i2/n+1)^ny):av=a*d
- 8280 ri=(1+i2)^(1/n):r2=(1+w2)^(1/n):r4=(1+fv(16)/100)^(1/n)
- 8290 w=(w2*q/n)/(1-1/(w2/n+1)^n4):wv=w*d+pt:an=0
- 8300 for k=1 to ty
- 8310 p=p*ri-a:q=q*r2-w:rk=r4^k
- 8320 cf=cf+av/rk:cw=cw+wv/rk
- 8330 tp=cf-(ps-p)/rk:tq=cw-(ps-q)/rk
- 8340 if tq<tp and an=0 then an=k
- 8350 if k/12=int(k/12) then t=k/12:p(t)=tp:q(t)=tq
- 8360 next
- 8370 print"[212]he payments on refinancing will be"
- 8380 if abs(a-w)<.5 then print"about the same as the old payments.":goto8420
- 8390 if a>w then rr=a-w:gosub1670:print" less than the old payments."
- 8400 if a<w then rr=w-a:gosub1670:print" more than the old payments."
- 8410 if an>0 then8440
- 8420 print"[210]efinancing with these terms costs you"
- 8430 print"money, so you probably shouldn't do it.":goto8470
- 8440 an=an/12:print"[217]ou must wait "fn r2(.1)"years for"
- 8450 print"the refinancing to be better than the"
- 8460 print"existing mortgage."h$
- 8470 gosub1860:on ra goto400,8180
- 8480 gosub600:goto8470
- 9000 rem--
- 9010 data "[201][210][193] [208]lanner",0," ",0
- 9020 data "[217]our age",4,42,0,65
- 9030 data "[195]urrent [201][210][193][160]balance",2,7100
- 9040 data "[212]his year's contribution",2,2000
- 9050 data "[197]stimated annual yield",1,9.23,0
- 9060 data "[195]urrent tax bracket",1,28,0
- 9070 data "[197]arly withdrawal penalty",1,10,0
- 9080 data "% of contribution deductible",1,100,0
- 9090 data "[210]etirement age",4,67,0,70
- 9100 data "[212]ax bracket when you withdraw",1,33,0
- 9110 data ir,e
- 9120 zt=9000:lc=36:gosub1550
- 9130 printcd$:sf=0
- 9140 gosub580
- 9150 gosub1840
- 9160 gosub780
- 9170 on qa goto400,9180,9160
- 9180 if fv(9)<=fv(2) then printfc$(2)" [199][210][197][193][212][197][210][160][212][200][193][206] "fc$(9):printer$:goto9420
- 9190 y=fv(9)-fv(2):ri=1+fv(5)*(100-fv(6))/10000
- 9200 r2=(100-fv(6))/100:r3=(100-fv(10))/100:i=1+fv(5)/100
- 9210 i2=fv(4)*i^y-fv(4):dr=fv(8)/100:nd=fv(4)-fv(4)*dr:dd=fv(4)*dr
- 9220 an=i2*r3+dd*r3-nd*r2*ri^y+nd:t3=fv(4)*r2:a2=ri^y*t3
- 9230 print"[195]ontribution will be worth $"int(an+.5)
- 9240 print"(after taxes) when you retire."
- 9250 print"[195]ompared to $"int(a2+.5)"outside the [201][210][193].":t=(100-fv(7))/100
- 9260 printr$"still calculating"
- 9270 t6=fv(3)*i^y*r3
- 9280 t3=fv(4)*r2:an=0
- 9290 for k=1 to y
- 9300 t4=(fv(4)*i^k-fv(4))*r3+dd*r3-nd*r2*ri^k+nd
- 9310 t6=t6+t4:if k+fv(2)>59 then t=1
- 9320 t8=t4-nd:t8=t8*t:t8=t8+nd
- 9330 t5=t3*ri^k:if t8>t5 and an=0 then an=k:t7=t4
- 9340 next
- 9350 printu$"[201]f you contribute this amount every"
- 9360 print"year you will have[160]$"int(t6)"when you"
- 9370 print"retire (after paying taxes). [212]his will"
- 9380 print"be worth $"int(t6/(1+fv(11)/100)^y)"after inflation."
- 9390 if an=0 then print"[193]n [201][210][193][160]may not be right for you.":goto9420
- 9400 print"[201]t will take"an"years before early"
- 9410 print"withdrawals are profitable."
- 9420 gosub1860:on ra goto400,9130
- 9430 gosub600:goto9420
-