10 ' FINANCE PROGRAM MONEY.BAS by: Gary Olander DESERT DATA 20 ' Ver 2-1 P.O.Box 1268, Sparks, Nevada 89431 (702)358-2690 30 ' Ver 2-2 2/87 CP/M-80 32 ' NOTE: PRINT CHR$(27);CHR$(69) is the screen clear routine for an H/Z 19 TERM. 40 D$="$######.##":D1$="$#####.##":D2$="$####.##" 50 PRINT CHR$(27);CHR$(69) 51 PRINT TAB(30)"$ $ MONEY $ $" 52 PRINT TAB(27)"Version 2-2 2/87" 53 PRINT:PRINT 60 PRINT TAB(28)"1 - Investments" 61 PRINT 70 PRINT TAB(28)"2 - Depreciation" 71 PRINT 80 PRINT TAB(28)"3 - Loans" 81 PRINT 90 PRINT TAB(28)"4 - Rule of ``78''" 91 PRINT 100 PRINT TAB(28)"5 - Payment schedule " 101 PRINT 110 PRINT TAB(28)"0 - End of Program" 120 GOSUB 1630:ON VAL(A$) GOSUB 150,220,280,360,1650 130 IF A$="0" THEN PRINT CHR$(27);CHR$(69):SYSTEM 140 GOTO 50 150 PRINT CHR$(27);CHR$(69) 151 PRINT TAB(28)" Investments" 152 PRINT:PRINT 160 PRINT TAB(22)"1 - One-time investment" 161 PRINT 170 PRINT TAB(22)"2 - Regular Deposits" 171 PRINT 180 PRINT TAB(22)"3 - Deposits required for savings goal" 181 PRINT 190 PRINT TAB(22)"4 - End this group" 191 PRINT 200 GOSUB 1630:ON VAL(A$) GOSUB 520,590,670 210 GOTO 50 220 PRINT CHR$(27);CHR$(69) 221 PRINT TAB(28)" Depreciation" 222 PRINT:PRINT 230 PRINT TAB(24)"1 - Double Declining" 231 PRINT 240 PRINT TAB(24)"2 - Straight Line" 241 PRINT 250 PRINT TAB(24)"3 - End this group" 251 PRINT 260 GOSUB 1630:ON VAL(A$) GOSUB 800,1040 270 GOTO 50 280 PRINT CHR$(27);CHR$(69) 281 PRINT TAB(28)" Loans" 282 PRINT:PRINT 290 PRINT TAB(22)"1 - Regular Payment" 291 PRINT 300 PRINT TAB(22)"2 - Last Payment" 301 PRINT 310 PRINT TAB(22)"3 - Remaining Balance" 311 PRINT 320 PRINT TAB(22)"4 - Cost of Borrowing" 321 PRINT 330 PRINT TAB(22)"5 - End this group" 331 PRINT 340 GOSUB 1630:ON VAL(A$) GOSUB 1220,1300,1400,1490 350 GOTO 50 360 PRINT CHR$(27);CHR$(69) 361 PRINT TAB(28)" Rule of ``78''" 362 PRINT 370 PRINT "Also known as the Sum of the Digits or The Direct Method." 380 PRINT "from the UCCC (Uniform Consumer Credit Code) Regulation, Referance" 390 PRINT "Office of Consumer Affairs, 112 E. 14th Ave.,Denver Col.80203" 400 PRINT "Enter the contract FINANCE CHARGE (total) ";:INPUT A 410 PRINT "Enter the number of MONTHS of contract term ";:INPUT N 420 PRINT "Enter the MONTHS LEFT on contract term" 430 PRINT "( a partial month counts as a whole ) ";:INPUT S 440 C=(S+1)*S:K=(N+1)*N:P=C/K:R=A*P:M=(N-S)*(N+S+1):B=(N+1)*N:E=M/B:F=A*E 450 PRINT "The refund factor of the finance charge = ";USING".##";P;:PRINT " %" 460 PRINT "The cost of borrowing factor = ";USING".##";E;:PRINT " %" 470 PRINT "The amount of PRE-PAYMENT REFUND is ";USING D$;R 480 PRINT "Cost of Borrowing using the Rule of ``78'' ";USING D$;F 490 GOSUB 1610 500 IF A$="Y" GOTO 360 510 GOTO 50 520 PRINT CHR$(27);CHR$(69) 521 PRINT TAB(26)"One time Investment" 522 PRINT 530 PRINT "Enter the initial investment ";:INPUT I1 540 PRINT "Enter the interest rate (A.P.R.)";:INPUT R 550 PRINT "Enter the Term (Years,Months) ";:INPUT Y,M 560 PRINT "Enter Number of Compounding Periods per year ";:INPUT N 570 R=R/N/100:Y=(12*Y+M)/12:T2=I1*(1+R)^(N*Y):T2=INT(T2*100+.5)/100:I2=T2-I1 580 GOSUB 760:GOSUB 1610:IF A$="Y" OR A$="y"THEN 520 ELSE 150 590 PRINT CHR$(27);CHR$(69) 591 PRINT TAB(26)"Regular Deposits" 592 PRINT 600 PRINT "Enter amount of each deposit ";:INPUT D 610 PRINT "Enter the interest rate (A.P.R.)";:INPUT R 620 PRINT "Enter the Term (Years,Months) ";:INPUT Y,M 630 PRINT "Enter Number of deposits a Year ";:INPUT N 640 R=R/N/100:Y=(Y*12+M)/12:T2=D*((1+R)^(N*Y)-1)/R:T2=INT(T2*100+.5)/100 650 I1=D*Y*N:I2=T2-I1 660 GOSUB 760:GOSUB 1610:IF A$="Y" OR A$="y" THEN 590 ELSE 150 670 PRINT CHR$(27);CHR$(69) 671 PRINT TAB(26)"Savings Goal Deposits" 672 PRINT 680 PRINT "Enter desired goal ";:INPUT T2 690 PRINT "Enter the interest rate (A.P.R.)";:INPUT R 700 PRINT "Enter the Term (Years,Months) ";:INPUT Y,M 710 PRINT "Enter Number of deposits a Year ";:INPUT N 720 R=R/N/100:Y=(Y*12+M)/12:D=T2*R/((1+R)^(N*Y)-1):D=INT(D*100+.5)/100 730 I1=D*Y*N:I2=T2-I1 740 PRINT CHR$(27);CHR$(69) 741 PRINT TAB(26)"Savings Goal Deposits" 742 PRINT 743 PRINT "Regular Deposits reguired ";USING D$;D 750 GOSUB 760:GOSUB 1610:IF A$="Y" OR A$="y" THEN 670 ELSE 150 760 PRINT "Net investment ";USING D$;I1 770 PRINT "Accumulative interest ";USING D$;I2 780 PRINT "Total investment Value ";USING D$;T2 790 RETURN 800 PRINT CHR$(27);CHR$(69) 801 PRINT TAB(28)"Double Declining Depreciation 802 PRINT 860 PRINT "Maximize annual double declining depreciation will change to"" straight line" 870 PRINT "once then double declining method is less than the straight"" line method 880 PRINT "Enter the original value ";:INPUT X 890 PRINT "Enter Depreciation term (Years) ";:INPUT Y 900 PRINT "Enter salvage Value at end of term ";:INPUT R 902 PRINT "Is this for 1 - SCREEN:, or 2 - PRINTER: ?":A$=INPUT$(1) 903 IF A$="1" THEN 906 904 IF A$="2" THEN GOSUB 2121 905 GOTO 902 906 PRINT 910 PRINT " YEARS AMOUNT CURRENT VALUE" 920 PRINT " 0";TAB(52);USING D$;X 930 K=0:Z=X-R 940 E=(2/Y)*Z 950 Z=Z-E:K=K+1:V=Z+R:PRINT TAB(10);K;TAB(30);USING D$;E; 960 PRINT TAB(52);USING D$;V 970 IF K=Y THEN 1000 980 IF E>(Z+1)/(Y-K) THEN 940 990 E=Z/(Y-K):IF K<=(Y-1) THEN 950 1000 PRINT :PRINT 1010 PRINT "THIS COMPUTATION IS A MAXIMIZE DOUBLE DECLINING DEPRECIATION" 1020 PRINT "for an asset worth $ ";X;" at purchase with $ ";R;" salvage value" 1030 CLOSE:GOSUB 1610:IF A$="Y" OR A$="y" THEN 800 ELSE 220 1040 PRINT CHR$(27);CHR$(69) 1041 PRINT TAB(28)"Straight Line Depreciation" 1042 PRINT 1100 PRINT "Enter the original value ";:INPUT X 1110 PRINT "Enter Depreciation term (Years) ";:INPUT Y 1120 PRINT "Enter salvage Value at end of term ";:INPUT R 1130 Z=X-R:J=0:D=Z/Y:V=X-D 1132 PRINT "Is this for 1 - SCREEN:, or 2 - PRINTER: ?":A$=INPUT$(1) 1133 IF A$="1" THEN 1136 1134 IF A$="2" THEN GOSUB 2301 1135 GOTO 1132 1136 PRINT 1140 PRINT " YEARS AMOUNT CURRENT VALUE" 1150 PRINT " 0";TAB(52);USING D$;X 1160 FOR J=1 TO Y:PRINT TAB(10);J;TAB(30);USING D$;D; 1170 PRINT TAB(52);USING D$;V:V=V-D:NEXT J 1180 PRINT :PRINT 1190 PRINT "This Computation is STRAIGHT LINE DEPRECIATION 1200 PRINT "for an asset worth $ ";X;" at purchase with $ ";R;" salvage value" 1210 CLOSE:GOSUB 1610:IF A$="Y" OR A$="y" THEN 1040 ELSE 220 1220 PRINT CHR$(27);CHR$(69) 1221 PRINT TAB(26)"Regular Loan Payment" 1222 PRINT 1230 PRINT "Enter the Principal amount ";:INPUT P1 1240 PRINT "Enter the Term (Years,Months) ";:INPUT Y,M 1250 PRINT "Enter the interest rate (A.P.R.)";:INPUT R 1260 PRINT "Enter number of Pmts per Year ";:INPUT N 1270 R=R/N/100:Y=(Y*12+M)/12:P3=1/(1+R)^(N*Y):P2=P1*R/(1-P3) 1280 PRINT "The Regular payment is ";USING D$;P2 1290 GOSUB 1610:IF A$="Y" OR A$="y" THEN 1220 ELSE 280 1300 PRINT CHR$(27);CHR$(69) 1301 PRINT TAB(26)"Last Loan Payment" 1302 PRINT 1310 PRINT "Enter the Principal amount ";:INPUT P1 1320 PRINT "Enter the Term (Years, Months) ";:INPUT Y,M 1330 PRINT "Enter the interest rate (A.P.R.)";:INPUT R 1340 PRINT "Enter number of Pmts per Year ";:INPUT N 1350 PRINT "Enter amount of Regular Payment";:INPUT P4 1360 R=R/N/100:Y=(Y*12+M)/12:I1=N*Y:FOR I=1 TO I1:R1=INT(P1*R*100+.5)/100 1370 R2=P4-R1:P1=P1-R2:NEXT I:P2=P4+P1 1380 PRINT "The Last Payment will be ";USING D$;P2 1390 GOSUB 1610:IF A$="Y" OR A$="y" THEN 1300 ELSE 280 1400 PRINT CHR$(27);CHR$(69) 1401 PRINT TAB(26)"Remaining Balance" 1402 PRINT 1410 PRINT "Enter the Principal amount ";:INPUT P1 1420 PRINT "Enter the Regular Payment ";:INPUT P4 1430 PRINT "Enter the interest rate (A.P.R.)";:INPUT R 1440 PRINT "Enter number of Pmts per Year ";:INPUT N 1450 PRINT "Enter number of Pmts made ";:INPUT I1 1460 R=R/N/100:FOR I=1 TO I1:R1=INT(P1*R*100+.5)/100:R2=P4-R1:P1=P1-R2:NEXT I 1470 PRINT "The Remaining Balance is ";USING D$;P1 1480 GOSUB 1610:IF A$="Y" OR A$="y" THEN 1400 ELSE 280 1490 PRINT CHR$(27);CHR$(69) 1491 PRINT TAB(26)"Cost of Borrowing" 1492 PRINT 1500 PRINT "Enter the Principal amount ";:INPUT P1 1510 PRINT "Enter the term (Years,Months) ";:INPUT Y,M 1520 PRINT "Enter the interest rate (A.P.R.)";:INPUT R 1530 PRINT "Enter number of Pmts per Year ";:INPUT N 1540 R=R/N/100:Y=(Y*12+M)/12:P3=1/(1+R)^(N*Y):P4=P1*R/(1-P3):P4=INT(P4*100+.5)/100:P5=P1:C=0:I1=N*Y 1550 FOR I=1 TO I1:R1=INT(P5*R*100+.5)/100:R2=P4-R1:P5=P5-R2:C=C+P4:NEXT I 1560 C=C+P5:C1=C-P1 1570 PRINT "Regular Payment ";USING D$;P4 1580 PRINT "Total of Payments ";USING D$;C 1590 PRINT "Cost of Borrowing ";USING D$;C1 1600 GOSUB 1610:IF A$="Y" OR A$="y" THEN 1490 ELSE 280 1610 PRINT "Another Calculation (Y or N) ";:A$=INPUT$(1) 1611 PRINT CHR$(27);CHR$(69) 1620 RETURN 1630 PRINT:PRINT 1631 PRINT TAB(20)"Enter one of the above option numbers ";:A$=INPUT$(1) 1632 PRINT 1640 RETURN 1650 PRINT CHR$(27);CHR$(69) 1660 PRINT 1670 PRINT TAB(28)"Payment Schedule " 1671 PRINT 1680 PRINT "Enter the Amount of the Loan ";:INPUT A# 1690 PRINT "Enter the interest rate (A.P.R.) ";:INPUT R 1700 R1=R 1710 PRINT "Enter the length of the loan (Months)";:INPUT M 1720 IF M<>INT(M) THEN 1710 1730 PRINT "Want the monthly payment calculated (Y/N) ?";:B$=INPUT$(1) 1740 R=R/1200 1750 IF B$="Y" OR B$="y" THEN 1790 1751 PRINT 1760 PRINT "What is the Monthly Payment ";:INPUT P 1770 GOTO 1811 1780 REM CALCULATE MONTHLY PAYMENT AND ROUND UP TO CENTS. 1790 C=(R+1)^M 1800 P=A#*((R*C)/(C-1)) 1810 P=(P*100)+1: P=INT(P):P=P/100 1811 PRINT "Is this for 1 - SCREEN:, or 2 - PRINTER: ?":A$=INPUT$(1) 1812 IF A$="1" THEN 1815 1813 IF A$="2" THEN GOSUB 2431 1814 GOTO 1811 1815 PRINT CHR$(27);CHR$(69) 1820 PRINT TAB(15)"The Monthly Payment is ";USING D$;P; 1830 PRINT TAB(15)"Amount of Loan ";USING D$;A#;:PRINT " at ";R1;" % Interest" 1840 PRINT TAB(15)"The payments are ";USING D2$;P; 1850 PRINT " for ";M;" Months.":PRINT 1860 Z=0:I2=0:N2#=0:P2=0:F=0 1870 B#=A#:GOSUB 2100 1880 FOR K=1 TO M 1890 I=B#*R 1900 I=(I*100)+1:I=INT(I):I=I/100 1910 IF K=M THEN P=B#+1 1920 P2=P2+P 1930 N=P-I:B#=B#-N:I2#=I2#+I:N2#=N2#+N 1940 PRINT TAB(1);K;TAB(8) USING D$;B#;:PRINT TAB(21);I;TAB(33) USING D$;I2#;:PRINT TAB(47);N;TAB(62);:PRINT USING D$;N2# 2000 V=V+1:IF V=12 THEN GOSUB 2091 2010 NEXT K 2011 PRINT 2020 PRINT TAB(8)"FINAL PAYMENT =";P 2040 PRINT TAB(8)"The Final Payment is ";TAB(32); 2050 PRINT USING D2$;P;:PRINT TAB(46);"Total of Payments $ ";P2 2060 PRINT TAB(8)"TOTAL PAYMENTS=";P2 2070 PRINT 2080 PRINT TAB(18)"WOULD YOU LIKE TO CALCULATE ANOTHER (Y/N) ?";:A$=INPUT$(1) 2090 IF A$="Y" OR A$="y" THEN 1650 ELSE 50 2091 PRINT 2092 PRINT TAB(16)"Press 1:, Key for next page or 0: Key to abort":A$=INPUT$(1) 2093 IF A$="1" THEN 2096 2094 IF A$="0" THEN 2080 2095 GOTO 2092 2096 PRINT CHR$(27);CHR$(69) 2100 PRINT TAB(22)"Amount of Loan ";USING D$;A# 2101 PRINT TAB(1)"Month Balance Interest Int.to Date Principle" " Princ.to Date" 2102 PRINT 2110 V=0:RETURN 2120 REM SUBROUTINE FOR PRINTER DDD 2121 PRINT "Please align paper and make printer ready, then press ";:LINE INPUT X$ 2130 LPRINT TAB(15)"Double Declining Depreciation Printout" 2140 LPRINT 2150 LPRINT " YEARS AMOUNT CURRENT VALUE" 2160 LPRINT " 0";TAB(52);USING D$;X 2170 K=0:Z=X-R 2180 E=(2/Y)*Z 2190 Z=Z-E:K=K+1:V=Z+R:LPRINT TAB(10);K;TAB(30);USING D$;E; 2200 LPRINT TAB(52);USING D$;V 2210 IF K=Y THEN 2240 2220 IF E>(Z+1)/(Y-K) THEN 2180 2230 E=Z/(Y-K):IF K<=(Y-1) THEN 2190 2240 LPRINT :LPRINT 2250 LPRINT "THIS COMPUTATION IS A MAXIMIZE DOUBLE DECLINING DEPRECIATION" 2260 LPRINT "for an asset worth $ ";X;" at purchase with $ ";R;" salvage value" 2270 LPRINT CHR$(12) 2280 CLOSE:GOSUB 1610:IF A$="Y" OR A$="y" THEN 800 ELSE 220 2290 RETURN 2300 REM SLD PRINTER SUBROUTINE 2301 PRINT "Please align paper and make printer ready, then press ";:LINE INPUT X$ 2310 LPRINT TAB(15) "Straight Line Depreciation Printout" 2320 LPRINT 2330 LPRINT " YEARS AMOUNT CURRENT VALUE" 2340 LPRINT " 0";TAB(52);USING D$;X 2350 FOR J=1 TO Y:LPRINT TAB(10);J;TAB(30);USING D$;D; 2360 LPRINT TAB(52);USING D$;V:V=V-D:NEXT J 2370 LPRINT :LPRINT 2380 LPRINT "This Computation is STRAIGHT LINE DEPRECIATION 2390 LPRINT "for an asset worth $ ";X;" at purchase with $ ";R;" salvage value" 2400 LPRINT CHR$(12) 2410 CLOSE:GOSUB 1610:IF A$="Y" OR A$="y" THEN 1040 ELSE 220 2420 RETURN 2430 REM PRINTER SUBROUTINE FOR PAYMENT SCHEDULE 2431 PRINT "Please align paper and make printer ready, then press ";:LINE INPUT X$ 2432 LPRINT TAB(22)"Payment Schedule Printout" 2440 LPRINT TAB(15)"The Monthly Payment is ";USING D$;P; 2450 LPRINT TAB(15)"Amount of Loan ";USING D$;A#;:LPRINT " at ";R1;" % Interest" 2460 LPRINT TAB(15)"The payments are ";USING D2$;P; 2470 LPRINT " for ";M;" Months.":LPRINT 2480 Z=0:I2=0:N2#=0:P2=0:F=0 2490 B#=A#:GOSUB 2680 2500 FOR K=1 TO M 2510 I=B#*R 2520 I=(I*100)+1:I=INT(I):I=I/100 2530 IF K=M THEN P=B#+1 2540 P2=P2+P 2550 N=P-I:B#=B#-N:I2#=I2#+I:N2#=N2#+N 2560 LPRINT TAB(1);K;TAB(8) USING D$;B#;:LPRINT TAB(21);I;TAB(33) USING D$;I2#;:LPRINT TAB(47);N;TAB(62);:LPRINT USING D$;N2# 2570 V=V+1:IF V=12 THEN GOSUB 2680 2580 NEXT K 2590 LPRINT TAB(8)"FINAL PAYMENT =";P 2610 LPRINT TAB(8)"The Final Payment is ";TAB(32); 2620 LPRINT USING D2$;P;:LPRINT TAB(46);"Total of Payments $ ";P2 2630 LPRINT TAB(8)"TOTAL PAYMENTS=";P2 2640 LPRINT CHR$(12) 2650 PRINT "WOULD YOU LIKE TO CALCULATE ANOTHER (Y/N) ?";:A$=INPUT$(1) 2660 IF A$="Y" OR A$="y" THEN 1650 ELSE 50 2670 LPRINT 2680 LPRINT TAB(1)"Month Balance Interest Int.to Date Principle" " Princ.to Date" 2690 LPRINT 2700 V=0:RETURN