10 PRINT "LAST PAYMENT ON A LOAN"
20 PRINT 
29 REM - STATEMENTS 30 TO 130 REQUEST USER INPUT
30 PRINT "REGULAR PAYMENT";
40 INPUT R
50 PRINT  "PRINCIPAL";
60 INPUT P 
70 PRINT "TERM IN YEARS";
80 INPUT Y
90 PRINT "ANNUAL INTEREST RATE";
100 INPUT I
109 REM - CONVERT INTEREST FROM PERCENT TO DECIMAL
110 I=I/100
120 PRINT "NUMBER OF PAYMENTS PER YEAR";
130 INPUT N
140 B0=P
149 REM - COMPUTE ALL PAYMENTS, BALANCES THROUGH LAST PAYMENT USING R
150 FOR J1=1 TO N*Y
159 REM - ROUND OFF INTEREST PAID TO NEAREST CENT
160 I1=INT((B0*I/N)*100+.5)/100
169 REM - CALCULATE AMOUNT AMORTIZED WITH EACH PAYMENT
170 A=R-I1
179 REM - BALANCE REMAINING DECREASES WITH EACH PAYMENT
180 B0=B0-A
190 NEXT J1
199 REM - CALCULATE LAST PAYMENT, ROUND OFF, PRINT
200 PRINT "LAST PAYMENT = $" ;INT((R+B0)*100+.5)/100
210 PRINT 
219 REM - RESTART OR END PROGRAM?
220 PRINT "MORE DATA? (1=YES,0=NO)";
230 INPUT X
240 IF X=1 THEN 20
250 END
