This 8K ROM/1K RAM program calculates the payments needed to pay off a loan or how many years it takes to pay off a loan at a fixed payment. If the fixed payment would never pay off the loan, an error code A results.
Suppose you wish to finance $50,000 for 30 years with an annual interest rate (APR) of 12%. In response to the prompts, enter 1 for payment, 30 for years to finance, 12 for payments per year, 12 for APR, and 50000 for loan size. Your monthly payments are $514.30.
Or you wish to finance $5000 at 14%. You can afford $200 per month. How long will it take to pay off the loan? Enter 2 for payoff years, 12 for payments per year, 14 for APR, 5000 for loan size, and 200 for payment. You’ll need 2.4774869 years.
10 PRINT AT 5,1;"FOR PAYMENT ENTER 1"
20 PRINT AT 9,1;"FOR PAYOFF YEARS ENTER 2"
30 INPUT Q
40 CLS
50 IF Q=2 THEN GOTO 80
60 PRINT AT 9,1;"YRS. TO FINANCE?"
70 INPUT Y
80 PRINT AT 9,1;"HOW MANY PAYMENTS PER YEAR?"
90 INPUT Z
100 CLS
110 IF Q=2 THEN GOTO 130
120 LET N=Z*Y
130 PRINT AT 9,9;"APR=?"
140 INPUT A
150 CLS
160 LET I=A/(100*Z)
170 PRINT AT 9,9;"LOAN SIZE?"
180 INPUT S
190 CLS
200 IF Q=2 THEN GOTO 250
210 LET B=I/(1-(1+I)**-N)
220 LET P=(INT (S*B*100))/100
230 PRINT AT 9,1;"EACH PAYMENT=$";P
240 STOP
250 PRINT AT 9,1;"PAYMENT=?"
260 INPUT R
270 CLS
280 LET N=(LN (R/(R-S*I)))/(LN (1+I))
290 LET N=N/Z
300 PRINT AT 9,1;"IT WOULD TAKE";N;" YRS"
310 STOP
SYNTACTIC SUM: 37820, 8K
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.