--- title: "Annuity" id: 76306 type: "computer_media" slug: "annuity" url: "http://localhost/computer_media/annuity/" markdown_url: "http://localhost/computer_media/annuity.md" published_at: "2026-11-11T08:03:13+00:00" modified_at: "2026-11-11T08:03:13+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/annuity-1.png" excerpt: "Work out the payment on a loan, or how many years a fixed payment will take to pay it off, on a 1K ZX81." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Robert Townsend" slug: "robert-townsend" taxonomy: "indiv" url: "http://localhost/indiv/robert-townsend/" genre: - name: "Finance" slug: "finance" taxonomy: "genre" url: "http://localhost/type/finance/" media_type: "Program" programmers: - name: "Robert Townsend" slug: "robert-townsend" taxonomy: "indiv" url: "http://localhost/indiv/robert-townsend/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Annuity%20%281982%29%28Townsend%2C%20Robert%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/annuity-1.png" - url: "http://localhost/wp-content/uploads/2026/11/annuity-2.png" article_media: - id: 19982 title: "Annuity" type: "article" url: "http://localhost/article/annuity/" media_type_tags: "Finance" license: false --- # Annuity 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](https://timexsinclair.com/article/annuity/)). ## 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 ```