Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0020/annuit.dem
There are 2 other files named annuit.dem in the archive. Click here to see a list.
100' NAME--ANNUITY
110'
120' DESCRIPTION--COMPUTES ANNUITIES
130'
140' SOURCE--UNKNOWN
150'
160' INSTRUCTIONS--TYPE "RUN" AND SUPPLY THE FOLLOWING DATA WHEN
170' REQUESTED TO DO SO:
180'
190' I = PERCENT INTEREST
200' T1= MONTHS BETWEEN COMPOUNDS
210' W = AMOUNT WITHDRAWN
220' T2= MONTHS BETWEEN WITHDRAWLS
230' P = ORIGINAL AMOUNT DEPOSITED
240'
250'
260' * * * * * MAIN PROGRAM * * * * * * * * * * *
270'
280 PRINT "THIS PROGRAM DETERMINES HOW LONG A PARTICULAR AMOUNT OF MONEY"
290 PRINT "WILL LAST WHEN INVESTED AT I PERCENT INTEREST, COMPOUNDED"
300 PRINT "EVERY T1 MONTHS AND AMOUNT W WITHDRAWN EVERY T2 MONTHS."
310 PRINT "THE ORIGINAL AMOUNT DEPOSITED IS P."
320 PRINT "SHOULD YOU WISH TO TERMINATE THE PROGRAM AT ANY TIME, TYPE 'STOP'."
330 REM THE DATA IN SUPPLIED THROUGH AN INPUT STATEMENT.
340 PRINT
350 PRINT "WHAT ARE I,T1,W,T2,P";
360 INPUT I, T1, W, T2, P
370 PRINT
380 PRINT "THE AMOUNT $" P "INVESTED AT AN ANNUAL INTEREST OF" I "PERCENT"
390 PRINT "COMPOUNDED EVERY" T1 "MONTHS, AND WITH $"W"WITHDRAWN"
400 PRINT "EVERY"; T2; " MONTHS,"
410 LET P1 = P
420 LET Y = 0
430 LET M = 0
440 LET I = I/100
450 LET I = 1 + I/12*T1
460 LET J = 0
470 LET K = 0
480 LET J = J+1
490 LET K = K+1
500 IF J = T1 THEN 590
510 IF K = T2 THEN 620
520 IF P <= 0 THEN 660
530 LET M = M+1
540 IF M = 12 THEN 560
550 GOTO 480
560 LET Y = Y+1
570 LET M = 0
580 GOTO 480
590 LET P = P*I
600 LET J = 0
610 GOTO 510
620 LET P = P - W
630 IF P > P1 THEN 710
640 LET K = 0
650 GOTO 520
660 LET P = P + W
670 PRINT "WILL LAST "; Y; "YEARS,"; M;" MONTHS,"
680 PRINT "WITH $" INT(100*P + .5)/100 "LEFT OVER."
690 PRINT
700 GOTO 350
710 PRINT "YOUR PLAN HAS THE PROPERTY THAT THE PRINCIPAL WILL"
720 PRINT "INCREASE WITHOUT BOUND. WHAT BANK DID YOU SAY YOU"
730 PRINT "DID YOUR BUSINESS WITH?"
740 PRINT
750 GOTO 350
760 DATA 100, 0, 3, 30, 1
770 END