Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0025/truint.bas
There are 2 other files named truint.bas in the archive. Click here to see a list.
00010	PRINT
00011	PRINT "THIS PROGRAM WILL CALCULATE THE TRUE ANNUAL INTEREST"
00012	PRINT "RATE CHARGED ON AN INSTALLMENT LOAN.  YOU SUPPLY THE"
00013	PRINT "VALUES OF FOUR VARIABLES:  A = AMOUNT OF LOAN (IN $),"
00014	PRINT "P = AMOUNT OF EACH PAYMENT ($), N = THE TOTAL NUMBER"
00015	PRINT "OF PAYMENTS DUE, AND  K = THE NUMBER OF PAYMENTS DUE"
00016	PRINT "IN ONE YEAR.  ";
00017	PRINT "WHAT ARE A,P,N,K";
00018	INPUT A, P, N, K
00019	PRINT
00020	IF N=1 THEN 60
00021	IF P*N>=A THEN 27
00022	PRINT
00023	PRINT "THAT'S NOT REASONABLE.  THE PAYMENTS ADD UP"
00024	PRINT "TO LESS THAN THE AMOUNT OWED.  TRY AGAIN:"
00025	PRINT
00026	GOTO 17
00027	LET R=0
00028	LET D=100
00029	GOSUB 38
00030	IF P=P1 THEN 48
00031	IF P>P1 THEN 34
00032	LET R=R-D
00033	GOTO 35
00034	LET R=R+D
00035	LET D=D/2
00036	IF D<0.0001 THEN 48
00037	GOTO 29
00038	LET R1=R/(100*K)
00039	LET Q=1+R1
00040	IF N*LOG(Q)/LOG(10)<=75 THEN 43
00041	LET P1=A*R1
00042	RETURN
00043	IF Q>1 THEN 46
00044	LET P1=A/N
00045	RETURN
00046	LET P1=A*Q^N*R1/(Q^N-1)
00047	RETURN
00048	LET R=0.01*INT(0.5+100*R)
00049	IF R<199.5 THEN 55
00050	PRINT
00051	PRINT "ARE YOU SURE THE DATA IS RIGHT?  THE INTEREST"
00052	PRINT "RATE WOULD BE OVER 200 PERCENT.  TRY AGAIN:"
00053	PRINT
00054	GOTO 17
00055	PRINT "THE TRUE ANNUAL INTEREST RATE = ";R
00056	PRINT
00057	PRINT
00058	PRINT "ANOTHER CASE?  (TYPE 'S' TO STOP NOW)."
00059	GOTO 17
00060	LET R=(P/A-1)*K
00061	LET R=100*R
00062	GOTO 48
00063	END