home *** CD-ROM | disk | FTP | other *** search
- 10 poke 53281,15:poke53280,15:printchr$(142)
- 90 dim b(5),b$(5)
- 100 print"[147] [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
- 101 print" [221] [146][221]"
- 105 print" [221] the lender's formula [146][221]"
- 110 print" [221] present value calculator [146][221]"
- 112 print" [221] by marty matthews [146][221]"
- 113 print" [221] [146][221]"
- 115 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
- 120 print"[144] 1 - (1+r/q)^-(y*q)
- 125 [153]" t = a * lentantantantantantantantantantantantanlenlenlenlenlen
- 130 print" (r/q)"
- 150 b$(1)="(t) total amount......":printb$(1)
- 160 b$(2)="(a) payment...........":printb$(2)
- 170 b$(3)="(r) rate/yr (.001-.5).":printb$(3)
- 180 b$(4)="(y) number of years...":printb$(4)
- 190 b$(5)="(q) payments/year.....":printb$(5)
- 200 y=12:x=24:forj=1to5:gosub1000:a2$=b$(j):print ">"
- 210 gosub 1100:b(j)=at:next
- 220 tt=b(1):aa=b(2):rr=b(3):yy=b(4):qq=b(5)
- 230 gosub800:ifa$="a"then700
- 240 ifa$="t" then 750
- 245 ifa$="r"then600
- 247 ifa$="y"then500
- 250 print " continue? (y/n) ":sys46374
- 255 wait 198,15:getb$:ifb$="y"then 100
- 260 ifb$="n" then goto2500
- 270 goto 255
- 500 gosub950:if a<>0 then goto 250
- 503 print " working !"
- 505 yx=yy:y1=75:y3=.08:y2=(y1-y3)/2.
- 510 yy=y1:gosub900:a1=tt/x1:if a1>aa then 590
- 512 yy=y3:gosub900:a3=tt/x1:if a3<aa then 590
- 514 yy=y2:gosub900:a2=tt/x1
- 520 if aa<a2thena3=a2:y3=y2:y2=y2+(y1-y2)/2:yy=y2:gosub900:a2=tt/x1:goto570
- 530 if aa>a2thena1=a2:y1=y2:y2=y2-(y2-y3)/2:yy=y2:gosub900:a2=tt/x1:goto570
- 540 print " years ";y2:yy=yx:b(4)=y2:goto250
- 570 if (y1-y3)<.0001 then 540
- 575 goto520
- 590 print "payment out of range for years!":goto250
- 600 gosub950:if a=1 then goto 250
- 603 print " working !"
- 605 rx=rr:r1=.5:r3=.001:r2=(r1-r3)/2.
- 610 rr=r1:gosub900:a1=tt/x1:if a1<aa then 690
- 612 rr=r3:gosub900:a3=tt/x1:if a3>aa then 690
- 614 rr=r2:gosub900:a2=tt/x1
- 620 if aa>a2thena3=a2:r3=r2:r2=r2+(r1-r2)/2:rr=r2:gosub900:a2=tt/x1:goto670
- 630 if aa<a2thena1=a2:r1=r2:r2=r2-(r2-r3)/2:rr=r2:gosub900:a2=tt/x1:goto670
- 640 print " rate ";r2:rr=rx:b(3)=r2:goto250
- 670 if (r1-r3)<.00001 then 640
- 675 goto620
- 690 print "payment out of range for rate!":goto250
- 700 gosub950:if a<>0 then goto 250
- 710 gosub900
- 720 aa=tt/x1:print " payment";aa
- 730 b(2)=aa:goto250
- 750 gosub950:if a<>0 then goto 250
- 760 gosub900:tt=aa*x1:print " total amount ";tt
- 770 b(1)=tt:goto250
- 800 print:print "solve for (select a,t,r,y): ";
- 805 wait198,15:geta$:goto885
- 810 print " ";a$;""
- 820 return
- 885 if(a$= "r"or a$= "t"or a$= "a"or a$ ="y") then810
- 890 goto805
- 900 x1=(1-((1+rr/qq)^(-yy*qq)))/(rr/qq)
- 910 if x1 = 0 then print "calculation error! check variables!":a=3:goto250
- 950 a=0:if qq=0 then a1$="pmts/yr ":gosub970:a=1:return
- 955 if a$="r"then 965
- 960 if rr=0 then a1$="rate/yr ":gosub970:a=2:return
- 965 return
- 970 print "missing variable for: ";a1$
- 980 return
- 1000 poke 214,y+j:poke211,x:print"[145]";:return
- 1100 rem get routine
- 1110 a1$=""
- 1120 get a$:if a$="" then 1120
- 1130 a=asc(a$):if a=20 thengosub1300:goto1190
- 1140 if a=13then 1200
- 1150 if a$="."ora$="," then1180
- 1160 if a$ = "-" and len(a1$) = 0 then 1180
- 1165 if a$ = "*" and len(a1$) = 0 then a1$=str$(b(j)):gosub1195:at=b(j):return
- 1170 if a < 48 or a > 60 then 1120
- 1180 a1$=a1$+a$
- 1190 gosub1195:goto 1120
- 1195 print "[145]"+a2$+": "+a1$+" ":return
- 1200 dv=0:l =len(a1$):a = 0:at = 0:p = 0:an = 1
- 1210 for i=1 to l:a$ = mid$(a1$,i,1)
- 1215 if a$="-" then an=-1:goto 1260
- 1220 ifa$=","then 1260
- 1230 if a$="."thendv=1:goto 1260
- 1240 if dv=0 then a=val(a$):at = at*10 + a
- 1250 if dv=1 then p=p+1:a=val(a$):at = at + a/(10^p)
- 1260 next:at=at*an:return
- 1300 l=len(a1$):ifl=0then return
- 1310 l=l-1:a1$=mid$(a1$,1,l):return
- 2500 rem exit to loadstar ****
- 2510 f$="hello connect":n$="loadstar"
- 2548 poke 53280,3:poke 53281,3
- 2550 print"[147]"tab((40-len(n$)-10)/2)"[204]oading "chr$(34)n$chr$(34)
- 2560 print"[159]new":print"load"chr$(34)f$chr$(34)",8,1"
- 2562 print"?c[200](144)c[200](142):run"
- 2570 poke198,3:poke631,13:poke632,13:poke633,13:end
-