home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Summer / rerun-1985-summer-side-b.d64 / landlord (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  7KB  |  277 lines

  1. 100 rem     silent partner
  2. 110 rem      wayne arnett
  3. 120 rem
  4. 130 print chr$(142),chr$(147)
  5. 140 print tab(11)"silent partner"
  6. 150 print tab(11)"--------------"
  7. 160 dim p(13),bb(12),sd(12)
  8. 170 dim m$(12),t$(19),d(19),u(19)
  9. 180 for i=1to12:read m$(i):next
  10. 190 for i=1to19:read t$(i):next
  11. 200 li$=" **************************************":rem space + 38 *
  12. 210 ul$="[163][163][163][163][163][163][163][163]":rem 8 comm. t's
  13. 220 f1$=chr$(133):f7$=chr$(136)
  14. 230 def fna(x)=int((x+.005)*100)/100
  15. 240 def fnb(x)=int((x+.0005)*1000)/10
  16. 250 h1$="summary statement: "
  17. 260 data january,february,march,april,may,june
  18. 265 :
  19. 270 data july,august,september,october,november,december
  20. 275 :
  21. 280 data beginning balance,owner deposit(s),rental income,other income
  22. 285 :
  23. 290 data total rent & other,loan pmt (piti),other loan pmts,utilities & water
  24. 295 :
  25. 300 data landscape,condo fee,repair & maint,advertising,misc expense
  26. 305 :
  27. 310 data total expense,owner withdrawal(s),ending balance,sec dep liability
  28. 315 :
  29. 320 data operating cash,cash flow this period
  30. 330 for i=1to19
  31. 340 for j=1 to 22-len(t$(i))
  32. 350 t$(i)=t$(i)+" ":rem 1 space
  33. 360 next j,i:goto390
  34. 365 :
  35. 370 rem *** menu
  36. 375 :
  37. 380 print"[147]"
  38. 390 print:print
  39. 400 print tab(8)"1 - ";tab(13)"enter data":print
  40. 410 print tab(8)"2 - ";tab(13)"read from files":print
  41. 420 print tab(8)"3 - ";tab(13)"exit program":print
  42. 430 printli$:print
  43. 440 print tab(7)"enter your choice - ";
  44. 450 input r:on r goto470,1990,2620
  45. 455 :
  46. 460 rem *** preliminary information
  47. 465 :
  48. 470 print"[147]":if key=0 then510
  49. 480 print"there's already data in memory. new"
  50. 490 print"entries will over-write old data. "
  51. 500 print:rt=1:goto2470
  52. 510 gosub2390
  53. 520 if ad$<>""then560
  54. 530 print"enter property address - max one line:"
  55. 540 print ">";:input ad$
  56. 550 if len(ad$)<2 then print"must have an address":goto540
  57. 560 ad$=left$(ad$,40):lf$=left$(ad$,2)
  58. 570 print:printli$
  59. 580 print"enter any comments or notes you want to"
  60. 590 print"appear on the printout - max 2 lines."
  61. 600 print ">";:input cm$
  62. 610 cm$=left$(cm$,80)
  63. 620 print:printli$:if gs then return
  64. 630 print"enter number of month of this summary."
  65. 640 print">";:input m:if m<1 or m>12 then640
  66. 645 :
  67. 650 rem *** collect and process data
  68. 655 :
  69. 660 print"[147]enter amounts for ";m$(m):print
  70. 670 for i=1to17
  71. 680 if i=5 or i=14 or i=16 then i=i+1
  72. 690 printi;tab(4)t$(i);
  73. 700 print "--- ";:input d(i)
  74. 710 if i=2 or i=4 then printli$
  75. 720 next:printli$:nd=1
  76. 730 print"check your entries - are there any"
  77. 740 print"mistakes? (y/n)";
  78. 750 input r$:if left$(r$,1)="y" then770
  79. 760 goto830
  80. 770 input"enter line no. that has an error";r
  81. 780 if r<1 or r>17then770
  82. 790 if r=5 or r=14 or r=16 then770
  83. 800 print"enter correction for line";r;
  84. 810 input ec:d(r)=ec
  85. 820 print"any other mistakes? (y/n)";:goto750
  86. 830 print"[147]":if pr>1000 then860
  87. 840 input"purchase price";pr
  88. 850 print:input"down payment";dp
  89. 855 :
  90. 860 print:printtab(11)"processing data"
  91. 870 key=1:d(5)=d(3)+d(4)
  92. 880 for i=6to13:d(14)=d(14)+d(i):next
  93. 890 d(16)=d(1)+d(2)+d(5)-d(14)-d(15)
  94. 900 d(18)=d(16)-d(17)
  95. 910 d(19)=d(5)-d(14)
  96. 920 for i=1to19:d(i)=fna(d(i)):next
  97. 930 if lm>fm then950
  98. 940 h2$=h1$+m$(m):goto960
  99. 950 h2$=h1$+m$(fm)+" to "+m$(lm)
  100. 960 if file=1 then1220
  101. 970 print"[147]do you want to record a file with"
  102. 980 print m$(m);"'s data? (y/n)";
  103. 990 input r$:if left$(r$,1)<>"y"then1220
  104. 995 :
  105. 1000 rem *** write to file
  106. 1005 :
  107. 1010 if lm>fm then1040 
  108. 1020 if file=1 then1070
  109. 1030 goto1090
  110. 1040 print:print"more than one month's data is in"
  111. 1050 print"memory. saving this will cause file"
  112. 1060 print"error!":print:goto2430
  113. 1070 print:print"don't try to resave same data"
  114. 1080 print:goto2430
  115. 1090 printli$:print"be sure disk drive is ready to record."
  116. 1100 print:rt=2:goto2470
  117. 1110 close1
  118. 1120 na$="0:"+lf$+m$(m)+",s,w"
  119. 1130 print na$:open1,8,9,na$
  120. 1140 print#1,m
  121. 1150 for j=1to13:if j=5 then j=6
  122. 1160 print#1,d(j):next
  123. 1170 print#1,d(15):print#1,d(17)
  124. 1180 print#1,pr:print#1,dp
  125. 1190 print#1,ad$
  126. 1200 close1:file=1
  127. 1205 :
  128. 1210 rem *** printout
  129. 1215 :
  130. 1220 print"[147]be sure printer is on, and the paper"
  131. 1230 print:print"positioned for an 11 inch run."
  132. 1240 print:printli$
  133. 1250 if lm>fm then gs=1:gosub580:gs=0
  134. 1260 print:rt=3:goto2470
  135. 1270 close3:open3,4
  136. 1280 print#3,chr$(14)h2$
  137. 1290 print#3:print#3,ad$;chr$(15)
  138. 1300 print#3:print#3,"notes:"
  139. 1310 print#3,cm$:cm$=""
  140. 1320 for i=1to39:print#3,"- ";:next
  141. 1330 print#3:print#3,chr$(14)
  142. 1340 print#3,chr$(16)"20income and expense"
  143. 1350 print#3,chr$(15):print#3
  144. 1360 m=0:t1=10:t2=5:t3=20
  145. 1370 for i=1to5:if i=3 then print#3
  146. 1380 gosub1450:next
  147. 1390 t1=15:t2=0:t3=13
  148. 1400 for i=6to14:gosub1450:next
  149. 1410 t1=10:t2=5:t3=20
  150. 1420 for i=15to19:gosub1440:next
  151. 1430 goto1570 
  152. 1440 if i=15 or i=17 or d(i)<0 then m=1
  153. 1450 u(i)=abs(d(i)):gs=1
  154. 1460 v=u(i):gosub2550:r$=v$
  155. 1470 l=len(r$):r$=right$(r$,l-1)
  156. 1480 print#3,tab(t1)t$(i);
  157. 1490 print#3,tab(t2)"------";
  158. 1500 if m then1520
  159. 1510 print#3,tab(t3-l)r$:goto1530
  160. 1520 print#3,tab(t3-(l+1));"(";r$;")"
  161. 1530 if i=5  or i=14 or i=16 then1550
  162. 1540 goto1560
  163. 1550 print#3,tab(t3+43-l);right$(ul$,l-1)
  164. 1560 m=0:return
  165. 1570 print#3:print#3:print#3,chr$(14)
  166. 1580 print#3,chr$(16)"22expense analysis"
  167. 1590 print#3,chr$(15)
  168. 1600 print#3:print#3,tab(3)"expenses:";
  169. 1610 print#3,tab(13)"dollar amount";
  170. 1620 print#3,tab(5)"% total exp.";
  171. 1630 print#3,tab(5)"% rental income"
  172. 1640 print#3
  173. 1650 for i=6to14
  174. 1660 v=d(i):gosub2550:r1$=v$
  175. 1670 p1=d(i)/d(14):p1=fnb(p1)
  176. 1680 v=p1:gosub2610:r2$=v$
  177. 1690 if d(3)=0 then r3$="n/a":goto1720
  178. 1700 p2=d(i)/d(3):p2=fnb(p2)
  179. 1710 v=p2:gosub2610:r3$=v$
  180. 1720 print#3,tab(3)t$(i);
  181. 1730 print#3,tab(9-len(r1$))r1$;
  182. 1740 print#3,tab(17-len(r2$))r2$;
  183. 1750 print#3,tab(19-len(r3$))r3$:next
  184. 1760 if pr<1000 or d(3)=0 then 1970
  185. 1770 print#3:print#3:print#3,chr$(14)
  186. 1780 print#3,chr$(16)"19investment analysis"
  187. 1790 print#3,chr$(15):print#3
  188. 1800 grm=pr/((d(3)/nd)*12):grm=fna(grm)
  189. 1810 cf=(d(19)/nd):cf=fna(cf)
  190. 1820 rn=(cf*12)/dp:rn=fnb(rn)
  191. 1830 be=(d(14)/nd):be=fna(be)
  192. 1840 gs=0:v=pr:gosub2550:pr$=v$
  193. 1850 print#3,"purchase price: ";pr$;
  194. 1860 v=dp:gosub2550:dp$=v$
  195. 1870 print#3,tab(20)"down payment: ";dp$
  196. 1880 print#3,"gross rent multiplier =";grm;
  197. 1890 if cf<0 thencf$=str$(cf):goto1910
  198. 1900 v=cf:gosub2550:cf$=v$
  199. 1910 print#3,tab(4)"average or present cash flow: ";cf$
  200. 1920 print#3,"return as an (annualized) percentage of down payment: ";
  201. 1930 print#3,rn;"%"
  202. 1940 v=be:gosub2550:be$=v$
  203. 1950 print#3,"monthly rent needed to break even based ";
  204. 1960 print#3,"on current/ave expenses: ";be$
  205. 1970 close3:goto380
  206. 1975 :
  207. 1980 rem *** readfrom file
  208. 1985 :
  209. 1990 if key=0 and file=0 then2030
  210. 2000 print"[147]there is data in memory which will be"
  211. 2010 print"lost while reading from files.":print
  212. 2020 print:rt=4:goto2470
  213. 2030 gosub2390
  214. 2040 print:print"[147]be sure disk drive is ready with the"
  215. 2050 print"correct file disk inserted."
  216. 2060 printli$
  217. 2070 print"enter number of first month to be read"
  218. 2080 print"from files into memory."
  219. 2090 print:input"first month";fm
  220. 2100 if fm<1 or fm>12 then2090
  221. 2110 print:print"to read more than one file (for a"
  222. 2120 print"summary) enter number of last month."
  223. 2130 print"otherwise, hit return without a number."
  224. 2140 print:input"last month";lm
  225. 2150 if lm<2 then lm=fm:nd=1:goto2180
  226. 2160 if lm>12 or lm<fm then print"invalid":lm=0:goto2140
  227. 2170 nd=(lm-fm)+1
  228. 2180 if lf$<>""then2220
  229. 2190 print:print"enter first 2 characters of the"
  230. 2200 input"property's address";lf$
  231. 2210 lf$=left$(lf$,2)
  232. 2220 print:close1
  233. 2230 for i=fm to lm
  234. 2240 na$=lf$+m$(i)
  235. 2250 print na$:open1,8,9,na$
  236. 2260 input#1,m:input#1,bb(i)
  237. 2270 for j=2to13:if j=5 then j=6
  238. 2280 input#1,p(j):d(j)=d(j)+p(j):nextj
  239. 2290 input#1,ow:d(15)=d(15)+ow
  240. 2300 input#1,sd(i)
  241. 2310 input#1,aa:if aa>1000 then pr=aa
  242. 2320 input#1,bb:if bb>100 then dp=bb
  243. 2330 input#1,ad$
  244. 2340 close1:nexti
  245. 2350 file=1:d(1)=bb(fm):d(17)=sd(lm)
  246. 2360 goto860 
  247. 2365 :
  248. 2370 rem *** subroutines
  249. 2375 :
  250. 2380 rem set variables to zero
  251. 2390 for i=1to19:d(i)=0:next
  252. 2400 file=0:key=0:fm=0:lm=0
  253. 2410 return
  254. 2420 rem function keys
  255. 2430 print tab(6)"<<< press 'f1' for menu >>>":printli$
  256. 2440 get r$:if r$=""then2440
  257. 2450 if r$=f1$ then380
  258. 2460 goto2440
  259. 2470 print tab(6)"<<< press 'f1' for menu >>>"
  260. 2480 print:print tab(12)"'f7' to proceed":printli$
  261. 2490 get r$:if r$=""then2490
  262. 2500 if r$=f1$ then380
  263. 2510 if r$=f7$ the