Annuity

Developer(s): Robert Townsend
Date: 1982
Type: Program
Platform(s): ZX81, TS 1000
Tags: Finance

A loan calculator for the 8K ROM in 1K. Enter 1 to find the payment: give the years to finance, payments per year, APR and loan size. Enter 2 to find the payoff time: give the payments per year, APR, loan size and payment. If the payment can never pay off the loan, the program stops with error A.

The article’s examples: $50,000 over 30 years at 12% with monthly payments gives $514.30; $5000 at 14% paid at $200 a month takes 2.4774869 years.

Published in Syntax June 1982 (Annuity).

Related Articles

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.

Image Gallery

Source Code

  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

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.