Works out the monthly payment on a mortgage or loan, rounded to the nearest dollar, and the total interest paid. Enter the principal, the yearly interest rate in percent and the length in years. Press a key, then N (or any key but Y) for another loan.
Lines 9993 and 9999 call the Larken disk system (RANDOMIZE USR 100), the second to save the program to disk. On a stock TS2068, answering Y to FINISHED? resets the computer, which clears the program as the NEW in that line would. Principal and is are spelled PRINCEPAL and 1S on the screen, as printed.
Published in The Plotter June 1990 (Simple Amortization).
Source Code
5 CLS
10 PRINT "PRINCEPAL IN $?": INPUT A
15 PRINT "$";A
20 PRINT "% INTEREST?": INPUT II
25 PRINT II;"%"
26 LET I=II/100
30 PRINT "LENGTH IN YEARS?": INPUT Y
35 PRINT Y
40 LET P=A*I/12/(1-(1+I/12)^-(12*Y))
50 PRINT "MONTHLY PAYMENT 1S ";: PRINT "$";INT (P+.5);".00"
60 LET PP=P*Y*12-A
70 PRINT "TOTAL INTEREST PAID ";: PRINT "$";INT ((PP+.005)*100)/100
75 PRINT
80 PRINT "MONTHLY PAYMENT rounded to the nearest dollar figure"
9900 PAUSE 0: CLS
9920 PRINT "FINISHED? Y/N"
9930 PAUSE 0: IF INKEY$="N" OR INKEY$="n" THEN CLS : GO TO 9991
9940 IF INKEY$="Y" OR INKEY$="y" THEN GO TO 9993
9991 GO TO 5
9993 RANDOMIZE USR 100: NEW
9999 RANDOMIZE USR 100: SAVE "AMOR.B1" LINE 5Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.



