home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1991 September
/
1991-09.d64
/
cc
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
130 lines
0 clr
5 rem copyright 1991 - compute publications intl ltd - all rights reserved
10 rem credit control -by g. reid. cc
20 mx=61:x=0:l=1:o$="10.5":p$="10th of month":m=10:cl=1000
30 dim d$(mx,4)
40 print"[147]"
50 forxx=1to5:print"":next:gosub980
60 print"";tab(13)"[195][210][197][196][201][212][160][195][207][206][212][210][207][204][154]"
70 printtab(13)"**************"
80 print chr$(14)
90 sy$="[159]":sz$="[146][154]"
100 n$(1)="[196]ata entry":n$(2)="[196]isplay"
110 n$(3)="[211]torage":n$(4)="[211]tatistics"
120 n$(5)="[197]xit"
130 for c=1to5:printtab(13) n$(c):next
140 print"[145][145][145][145][145][145]":c=1:printtab(13)sy$n$(1)sz$
150 getg$:ifg$=""then150
160 ifg$=chr$(13)then200
170 ifg$=""then print"[145]";tab(13)n$(c):c=c+1:printtab(13)sy$n$(c)sz$
180 ifc=6thenprint"[145]";:goto140
190 goto150
200 on c goto330,570,730,210,1240
210 print"[147][211]tatistical data entry":print
220 print"[197]nter your new:-"
230 print"[193]nnual finance charge rate"
240 print"[195]urrent is--";o$:input o$:ifval(o$)<1then210
250 print"[205]onthly payment date"
260 print"[195]urrent is--";p$:input p$
270 print"[194]udgeted maximum monthly credit"
280 print"purchases amount $"
290 print"[195]urrent is--";m:input m:ifm<1then270
300 print"[193]ssigned [195]redit [204]imit"
310 print"[195]urrent is--";cl:input cl
320 goto40
330 x=x+1:y=0:i$="--":ifx>mx-1thenprint"[147][198]ull file":x=l:goto430
340 print"[147][197]nter [205]onth & day of purchase":gosub420
350 print"[147][197]nter [211]eller's [206]ame/[196]escription":gosub420
360 print"[147][197]nter [193]mount (charged or paid) $"
370 print"([208]ayment must be minus e.g. -56)":l=x:gosub420
380 b2=b2+val(d$(x,3)):b2=int(b2*100+.5)/100:d$(x,4)=str$(b2)
390 ifval(d$(x,3))<0thenb4=b3:b3=b2
400 ifx=lthen430
410 x=x+1:goto520
420 inputi$:y=y+1:d$(x,y)=i$:i$="--":return
430 print" e=enter: c=changes: m=menu: d=display"
440 get n$:ifn$=""then440
450 if n$="e"then330
460 if n$="c"then500
470 if n$="m"then40
480 if n$="d"then570
490 goto440
500 print"[147][200]it [210][197][212][213][210][206] after changes or to by-pass an entry"
510 x=x-1:ifx<1thenx=1
520 print"[197]nter new data at cursor:-"
530 b2=val(d$(x-1,4)):print
540 print"#";x;tab(5)"[196]ate: ";d$(x,1);:input d$(x,1)
550 printtab(5)"[211]eller: ";left$(d$(x,2),13);:input d$(x,2)
560 printtab(5)"[193]mount: ";d$(x,3);:input d$(x,3):print:goto380
570 g=1:c2=18:c1=c2
580 print"[147]";c$:print" [206]o [196]ate [211]eller/[196]etail [193]mount [194]alance"
590 print" -- ---- ------------- ------ -------"
600 for c=gto l
610 printc;tab(4)left$(d$(c,1),6);tab(10)left$(d$(c,2),13);
620 printtab(23);:f$=d$(c,3)
630 gosub640:f$=d$(c,4):gosub640:print:goto680
640 f$=" "+f$:ft$=right$(f$,3):ifleft$(ft$,1)="."then670
650 ifmid$(ft$,2,1)="."thenf$=f$+"0":goto670
660 f$=f$+".00"
670 printright$(f$,8);:return
680 if c<c1then720
690 print"[210][197][212][213][210][206]"
700 get pa$:ifpa$=""then700
710 c1=c1+c2
720 next:print:goto430
730 print"[147]":input"[197]nter file-name";c$
740 print" l=load: s=save"
750 get x$:ifx$=""then750
760 ifx$="l"then900
770 ifx$<>"s"then750
780 print"[215]ish to [158][211][193][214][197][154] ";c$;" ? [217]/[206]"
790 getx$:ifx$=""then790
800 ifx$<>"y"then40
810 open 1,8,2,"@0:cdf"+c$+",s,w"
820 q$=chr$(13)
830 print#1,p$q$o$q$m,q$l,q$cl
840 c=1:y=1
850 if c>lthen890
860 a$=d$(c,y):print#1,a$:y=y+1
870 if y>4then y=1:c=c+1
880 goto850
890 close 1:print"[147]saved "c$:goto50
900 open 1,8,2,"0:cdf"+c$+",s,r"
910 input# 1,p$,o$,m,l,cl
920 c=1:y=1
930 if c>lthen970
940 input#1,a$:d$(c,y)=a$:y=y+1
950 if y>4then y=1:c=c+1
960 goto930
970 close 1:x=l:b2=val(d$(c-1,4)):goto570
980 u=val(d$(x,4))
990 um=int((u-m)*100+.5)/100
1000 print:print"[158][211]elect[154] with cursor and [210][197][212][213][210][206]"
1010 print"";tab(10)"-----------------"
1020 print"[217]our current balance is $";
1030 ifu>mthenprint"[150]"u"[154]":goto1050
1040 printu:ifu=<0thenprint" [195]ongratulations!":goto1230
1050 if(cl-u)<cl*.2 then print" [217]our credit limit is $";cl
1060 ifval(d$(x,3))<0then1090
1070 print" [212]o avoid [198]inance [195]harge at ";o$;"% [193][208][210],"
1080 print" [208]lease pay by ";p$;"[154]"
1090 ifu=<m then1230
1100 print"[129][194]alance exceeds $";str$(m);"-budget by";um
1110 r=val(o$)/12/100:if(u/m*r) >.99999then1210
1120 n=log(1/(1-(u/m*r)))/log(1+r)
1130 print" [201]f no further purchases, it takes"
1140 printint(n*10+.5)/10;"months to pay off.[154]"
1150 if n<1.15then1230
1160 if val(d$(x,3))<(.25*m)then if u<b4thenprint" [199]ood trend...but"
1170 if n>2 then1220
1180 print"[150][201]ncrease your budget to $";int(m*n);
1190 if n<1.5then1230
1200 print" or":goto1220
1210 print"[150] [195]annot be repaid. [194]udget of $";m;"is very low. [210][197][208][197][193][212]!"
1220 print"[158][200][201][196][197][160][217][207][213][210][160][195][193][210][196] [193][215][193][217]![154]"
1230 return
1240 print"[196]id you save your data? [217]/[206]"
1250 gets$:if s$=""then1250
1260 if s$="y"then print"[147]":end
1270 goto40