home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 September / 1991-09.d64 / cc (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  130 lines

  1. 0 clr
  2. 5 rem copyright 1991 - compute publications intl ltd - all rights reserved
  3. 10 rem credit control -by g. reid. cc
  4. 20 mx=61:x=0:l=1:o$="10.5":p$="10th of month":m=10:cl=1000
  5. 30 dim d$(mx,4)
  6. 40 print"[147]"
  7. 50 forxx=1to5:print"":next:gosub980
  8. 60 print"";tab(13)"[195][210][197][196][201][212][160][195][207][206][212][210][207][204][154]"
  9. 70 printtab(13)"**************"
  10. 80 print chr$(14)
  11. 90 sy$="[159]":sz$="[146][154]"
  12. 100 n$(1)="[196]ata entry":n$(2)="[196]isplay"
  13. 110 n$(3)="[211]torage":n$(4)="[211]tatistics"
  14. 120 n$(5)="[197]xit"
  15. 130 for c=1to5:printtab(13) n$(c):next
  16. 140 print"[145][145][145][145][145][145]":c=1:printtab(13)sy$n$(1)sz$
  17. 150 getg$:ifg$=""then150
  18. 160 ifg$=chr$(13)then200
  19. 170 ifg$=""then print"[145]";tab(13)n$(c):c=c+1:printtab(13)sy$n$(c)sz$
  20. 180 ifc=6thenprint"[145]";:goto140
  21. 190 goto150
  22. 200 on c goto330,570,730,210,1240
  23. 210 print"[147][211]tatistical data entry":print
  24. 220 print"[197]nter your new:-"
  25. 230 print"[193]nnual finance charge rate"
  26. 240 print"[195]urrent is--";o$:input o$:ifval(o$)<1then210
  27. 250 print"[205]onthly payment date"
  28. 260 print"[195]urrent is--";p$:input p$
  29. 270 print"[194]udgeted maximum monthly credit"
  30. 280 print"purchases amount $"
  31. 290 print"[195]urrent is--";m:input m:ifm<1then270
  32. 300 print"[193]ssigned [195]redit [204]imit"
  33. 310 print"[195]urrent is--";cl:input cl
  34. 320 goto40
  35. 330 x=x+1:y=0:i$="--":ifx>mx-1thenprint"[147][198]ull file":x=l:goto430
  36. 340 print"[147][197]nter [205]onth & day of purchase":gosub420
  37. 350 print"[147][197]nter [211]eller's [206]ame/[196]escription":gosub420
  38. 360 print"[147][197]nter [193]mount (charged or paid) $"
  39. 370 print"([208]ayment must be minus e.g.  -56)":l=x:gosub420
  40. 380 b2=b2+val(d$(x,3)):b2=int(b2*100+.5)/100:d$(x,4)=str$(b2)
  41. 390 ifval(d$(x,3))<0thenb4=b3:b3=b2
  42. 400 ifx=lthen430
  43. 410 x=x+1:goto520
  44. 420 inputi$:y=y+1:d$(x,y)=i$:i$="--":return
  45. 430 print" e=enter: c=changes: m=menu: d=display"
  46. 440 get n$:ifn$=""then440
  47. 450 if n$="e"then330
  48. 460 if n$="c"then500
  49. 470 if n$="m"then40
  50. 480 if n$="d"then570
  51. 490 goto440
  52. 500 print"[147][200]it [210][197][212][213][210][206] after changes or to by-pass  an entry"
  53. 510 x=x-1:ifx<1thenx=1
  54. 520 print"[197]nter new data at cursor:-"
  55. 530 b2=val(d$(x-1,4)):print
  56. 540 print"#";x;tab(5)"[196]ate:   ";d$(x,1);:input d$(x,1)
  57. 550 printtab(5)"[211]eller: ";left$(d$(x,2),13);:input d$(x,2)
  58. 560 printtab(5)"[193]mount: ";d$(x,3);:input d$(x,3):print:goto380
  59. 570 g=1:c2=18:c1=c2
  60. 580 print"[147]";c$:print" [206]o [196]ate  [211]eller/[196]etail  [193]mount [194]alance"
  61. 590 print" -- ----  -------------  ------ -------"
  62. 600 for c=gto l
  63. 610 printc;tab(4)left$(d$(c,1),6);tab(10)left$(d$(c,2),13);
  64. 620 printtab(23);:f$=d$(c,3)
  65. 630 gosub640:f$=d$(c,4):gosub640:print:goto680
  66. 640 f$="     "+f$:ft$=right$(f$,3):ifleft$(ft$,1)="."then670
  67. 650 ifmid$(ft$,2,1)="."thenf$=f$+"0":goto670
  68. 660 f$=f$+".00"
  69. 670 printright$(f$,8);:return
  70. 680 if c<c1then720
  71. 690 print"[210][197][212][213][210][206]"
  72. 700 get pa$:ifpa$=""then700
  73. 710 c1=c1+c2
  74. 720 next:print:goto430
  75. 730 print"[147]":input"[197]nter file-name";c$
  76. 740 print" l=load:  s=save"
  77. 750 get x$:ifx$=""then750
  78. 760 ifx$="l"then900
  79. 770 ifx$<>"s"then750
  80. 780 print"[215]ish to [158][211][193][214][197][154] ";c$;" ? [217]/[206]"
  81. 790 getx$:ifx$=""then790
  82. 800 ifx$<>"y"then40
  83. 810 open 1,8,2,"@0:cdf"+c$+",s,w"
  84. 820 q$=chr$(13)
  85. 830 print#1,p$q$o$q$m,q$l,q$cl
  86. 840 c=1:y=1
  87. 850 if c>lthen890
  88. 860 a$=d$(c,y):print#1,a$:y=y+1
  89. 870 if y>4then y=1:c=c+1
  90. 880 goto850
  91. 890 close 1:print"[147]saved "c$:goto50
  92. 900 open 1,8,2,"0:cdf"+c$+",s,r"
  93. 910 input# 1,p$,o$,m,l,cl
  94. 920 c=1:y=1
  95. 930 if c>lthen970
  96. 940 input#1,a$:d$(c,y)=a$:y=y+1
  97. 950 if y>4then y=1:c=c+1
  98. 960 goto930
  99. 970 close 1:x=l:b2=val(d$(c-1,4)):goto570
  100. 980 u=val(d$(x,4))
  101. 990 um=int((u-m)*100+.5)/100
  102. 1000 print:print"[158][211]elect[154] with cursor and [210][197][212][213][210][206]"
  103. 1010 print"";tab(10)"-----------------"
  104. 1020 print"[217]our current balance is $";
  105. 1030 ifu>mthenprint"[150]"u"[154]":goto1050
  106. 1040 printu:ifu=<0thenprint" [195]ongratulations!":goto1230
  107. 1050 if(cl-u)<cl*.2 then print" [217]our credit limit is $";cl
  108. 1060 ifval(d$(x,3))<0then1090
  109. 1070 print" [212]o avoid [198]inance [195]harge at ";o$;"% [193][208][210],"
  110. 1080 print" [208]lease pay by ";p$;"[154]"
  111. 1090 ifu=<m then1230
  112. 1100 print"[129][194]alance exceeds $";str$(m);"-budget by";um
  113. 1110 r=val(o$)/12/100:if(u/m*r) >.99999then1210
  114. 1120 n=log(1/(1-(u/m*r)))/log(1+r)
  115. 1130 print" [201]f no further purchases, it takes"
  116. 1140 printint(n*10+.5)/10;"months to pay off.[154]"
  117. 1150 if n<1.15then1230
  118. 1160 if val(d$(x,3))<(.25*m)then if u<b4thenprint" [199]ood trend...but"
  119. 1170 if n>2 then1220
  120. 1180 print"[150][201]ncrease your budget to $";int(m*n);
  121. 1190 if n<1.5then1230
  122. 1200 print" or":goto1220
  123. 1210 print"[150] [195]annot be repaid.  [194]udget of $";m;"is    very low.  [210][197][208][197][193][212]!"
  124. 1220 print"[158][200][201][196][197][160][217][207][213][210][160][195][193][210][196] [193][215][193][217]![154]"
  125. 1230 return
  126. 1240 print"[196]id you save your data?   [217]/[206]"
  127. 1250 gets$:if s$=""then1250
  128. 1260 if s$="y"then print"[147]":end
  129. 1270 goto40
  130.