Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50110/truint.dem
There are 2 other files named truint.dem in the archive. Click here to see a list.
100' NAME--TRUINT
110'
120' DESCRIPTION--COMPUTES THE TRUE INTEREST RATES FROM INSTALLMENT
130' PAYMENTS.
140'
150' SOURCE--UNKNOWN
160'
170' INSTRUCTIONS--TYPE "RUN" AND FOLLOW INSTRUCTIONS.
180'
190'
200' * * * * * * * MAIN PROGRAM * * * * * * * * * * * *
210'
220 PRINT
230 PRINT "THIS PROGRAM WILL CALCULATE THE TRUE ANNUAL INTEREST"
240 PRINT "RATE CHARGED ON AN INSTALLMENT LOAN. YOU SUPPLY THE"
250 PRINT "VALUES OF FOUR VARIABLES: A = AMOUNT OF LOAN (IN $),"
260 PRINT "P = AMOUNT OF EACH PAYMENT ($), N = THE TOTAL NUMBER"
270 PRINT "OF PAYMENTS DUE, AND K = THE NUMBER OF PAYMENTS DUE"
280 PRINT "IN ONE YEAR. ";
290 PRINT "WHAT ARE A,P,N,K";
300 INPUT A, P, N, K
310 PRINT
320 IF N=1 THEN 720
330 IF P*N>=A THEN 390
340 PRINT
350 PRINT "THAT'S NOT REASONABLE. THE PAYMENTS ADD UP"
360 PRINT "TO LESS THAN THE AMOUNT OWED. TRY AGAIN:"
370 PRINT
380 GOTO 290
390 LET R=0
400 LET D=100
410 GOSUB 500
420 IF P=P1 THEN 600
430 IF P>P1 THEN 460
440 LET R=R-D
450 GOTO 470
460 LET R=R+D
470 LET D=D/2
480 IF D<0.0001 THEN 600
490 GOTO 410
500 LET R1=R/(100*K)
510 LET Q=1+R1
520 IF N*LOG(Q)/LOG(10)<=75 THEN 550
530 LET P1=A*R1
540 RETURN
550 IF Q>1 THEN 580
560 LET P1=A/N
570 RETURN
580 LET P1=A*Q^N*R1/(Q^N-1)
590 RETURN
600 LET R=0.01*INT(0.5+100*R)
610 LET R2=.01*INT(.5+10000*((1+R/(100*K))^K-1))
620 IF R<199.5 THEN 670
630 PRINT
640 PRINT "RATE WOULD BE OVER 200 PERCENT. TRY AGAIN:"
650 PRINT
660 GOTO 290
670 PRINT "TRUE ANNUAL INTEREST RATE (NOMINAL) = ";R
680 PRINT "TRUE ANNUAL INTEREST RATE (EFFECTIVE) = ";R2
690 PRINT
700 PRINT "ANOTHER CASE? (TYPE 'S' TO STOP NOW)."
710 GOTO 290
720 LET R=(P/A-1)*K
730 LET R=100*R
740 GOTO 600
750 END