Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0020/demand.bnk
There are 2 other files named demand.bnk in the archive. Click here to see a list.
10' NAME--DEMAND
20'
30' DESCRIPTION--COMPUTES THE INTEREST DUE, THE TOTAL INTEREST DUE,
32' THE OUTSTANDING BALANCE, AND THE TOTAL OUTSTANDING BALANCE
34' FOR ALL DEMAND LOANS.
40'
50' SOURCE--REVISED 8/8/69 BY J. ROKUS
60'
70' THIS PROGRAM WAS WRITTEN FOR STUDENT USE AT AMOS TUCK SCHOOL
72' OF HANOVER, N.H., WHICH DOES NOT ASSUME RESPONSIBILITY FOR
74' ITS ACCURACY.
80'
85' * * * * * * * * * * * * MAIN PROGRAM * * * * * * * * * * * * * *
90'
100 READ N4,D4,S(0),T(0),S3,B$
110 CHANGE B$ TO O
120 LET S9= 32-O(0)/2
130 CHANGE O TO B$
140 DIM M(12),O(60),S(60),T(60),U(60)
150 FOR S6= 1 TO 60
160 LET S(S6)=T(S6)=U(S6)=10
170 NEXT S6
180 CHANGE S TO S1$
185 CHANGE T TO S2$
190 MAT READ M(12)
200
220 REM FUNCTION TO CONVERT DATE TO DAYS SINCE THE BEGINNING OF THE
230 REM YEAR. IT PUTS MONTH, DAY AND YEAR IN M, D5, AND Y. IT ALSO
240 REM PUTS THE PREVIOUS MONTH, DAY AND YEAR IN M8, D8, AND Y8.
245 DEF FND(D9)
250 LET Y8=Y
260 LET D8=D5
270 LET M8=M
280 LET Y=(D9-INT(D9/100)*100)
290 LET D5=(D9-(INT(D9/10000)*10000)-Y)/100
300 LET M=INT(D9/10000)
310 IF D9=D4 THEN 380
320 IF D9<367 THEN 510
330 IF M<1 THEN 490
340 IF D5>M(M) THEN 490
350 IF D<1 THEN 490
360 IF Y<(Y6-5) THEN 490
370 IF Y>Y6 THEN 490
380 FOR A9 = 1 TO M-1
390 LET FND=FND+M(A9)
400 NEXT A9
410 LET FND=FND+D5
420 IF Y=Y6+1 THEN 450
430 IF Y=Y6-1 THEN 470
440 GOTO 520
450 LET FND=FND+365
460 GOTO 520
470 LET FND=FND-365
480 GOTO 520
490 PRINT "ERROR--ILLEGAL DATE:";D9
500 GOTO 520
510 LET FND=D9
511 LET M=0
512 LET M=M+1
513 IF D9<=M(M) THEN 516
514 LET D9=D9-M(M)
515 GOTO 512
516 LET D5=D9
517 LET Y=Y6
520 FNEND
530
540 REM: PRINTS DATE WITH SLASHES, NO SPACES
550 DEF FNM(A9,B9,C9)
560 LET X9=FNB(C9)+FNB(B9)+FNB(A9)
570 LET Q(0)=8
580 CHANGE Q TO R9$
590 IF P$="NO" THEN 610
600 PRINT R9$;
610 FNEND
620 DEF FNB(N9)
630 LET Z9=INT(N9/10)
640 LET Q(8-X9)=N9-10*Z9+48
650 LET Q(7-X9)=(Z9+47)*SGN(Z9)+1
660 LET Q(6-X9)=47
670 LET X9=X9+3
680 FNEND
690
700 REM: PRINT N9 IN DOLLARS AND CENTS FORMAT
705 REM AND ALIGN DECIMAL POINTS.
710 DEF FNP(N9)
720 IF N9=0 THEN 1070
730 LET P9=0
740 LET C9=INT(N9*100+.5)
750 LET F9=INT(C9/100)
760 LET R9=C9-100*F9
770 LET P9=P9+1
780 LET T9=INT(F9/10)
790 LET O(P9)=F9-10*T9+48
800 LET F9=T9
810 IF F9>0 THEN 770
820 LET O(0)=P9+3
830 LET O(P9+1)=46
840 LET O(P9+2)=INT(R9/10)
850 LET O(P9+3)=R9-O(P9+2)*10+48
860 FOR I9= 1 TO P9/2
870 LET T9=O(I9)
880 LET O(I9)=O(P9+1-I9)
890 LET O(P9+1-I9)=T9
900 NEXT I9
910 LET O(P9+2)=O(P9+2)+48
920 CHANGE O TO Q$
930 LET U9=0
940 LET U9=U9+1
950 IF U9=O(0) THEN 1020
960 IF O(U9)<>46 THEN 940
970 FOR V9= 1 TO 7-U9
980 LET P(V9)=32
990 NEXT V9
1000 LET P(0)=V9
1010 CHANGE P TO M$
1020 CHANGE O TO Q$
1030 IF P$="NO" THEN 1050
1040 PRINT M$"$"Q$;
1050 LET FNP=C9/100
1060 GOTO 1090
1070 IF P$="NO" THEN 1090
1080 PRINT" 0";
1090 FNEND
1100
1110 PRINT"DO YOU WANT FORMS PRINTED (YES OR NO)";
1120 INPUT P$
1125 PRINT""
1130 LET D2=FND(D4)
1140 LET D6=D5
1150 LET Y6=Y
1160 LET M6=M
1162 IF Y/4<>INT(Y/4) THEN 1170
1164 LET M(2)=29
1170 PRINT
1220 LET I=F5=0
1230 LET X=X+1
1240 IF T6=3 THEN 1310
1245 LET T6=0
1248 LET D0=0
1250 READ N,N$
1260 IF N$="END" THEN 2400
1270 READ A$,T$,D,A,R
1280 IF D=0 THEN 99996
1290 IF R<1 THEN 1310
1300 LET R=R/100
1310 IF P$="NO" THEN 1420
1320 PRINT TAB(S9);B$
1330 PRINT TAB(15) "STATEMENT OF DEMAND LOAN INTEREST"
1340 PRINT TAB(26);
1350 LET A9=FNM(M6,D6,Y6)
1360 PRINT S1$
1370 PRINT TAB(9); N$; TAB(51); N
1380 PRINT TAB(9); A$
1390 PRINT TAB(9); T$
1400 PRINT S2$
1410 PRINT"DATE FROM DATE TO DAYS PAYMENT BALANCE RATE INTEREST"
1420 IF D0<>0 THEN 1510
1430 LET D=FND(D4)
1440 IF M<4 THEN 1470
1450 LET M=M-3
1460 GOTO 1480
1470 LET M=M+9
1480 LET D=FND(Y+D5*100+M*10000)
1500 GOTO 1520
1510 LET D=FND(D)
1520 LET P=0
1530
1540 REM: PAYMENTS LOOP
1550 FOR G9= 1 TO N4
1570 READ D1
1580 IF D1=0 THEN 1990
1590 READ P1,R1
1600 IF R1=0 THEN 1690
1610 IF D<>0 THEN 1690
1620 LET D=FND(D4)
1630 IF M<4 THEN 1660
1640 LET M=M-3
1650 GOTO 1670
1660 LET M=M+9
1670 LET D=FND(Y+D5*100+M*10000)
1680 LET F5=0
1690 LET D1=FND(D1)
1700 IF D1<=D THEN 99992
1710 LET D3=D1-D
1720 LET I7=D3*R*A/360
1730 LET A9=FNM(M8,D8,Y8)
1740 IF P$="NO" THEN 1760
1750 PRINT TAB(12);
1760 LET A9=FNM(M,D5,Y)
1770 IF P$="NO" THEN 1790
1780 PRINT TAB(22); D3; TAB(26);
1790 LET P=FNP(P)
1800 IF P$="NO" THEN 1820
1810 PRINT TAB(36);
1820 LET A=FNP(A)
1830 IF P$="NO" THEN1850
1840 PRINT TAB(48); R*100; TAB(54);
1850 LET I7=FNP(I7)
1860 LET I=I+I7
1870 IF P$="NO" THEN 1890
1880 PRINT
1890 LET D=D1
1900 LET P=P1
1910 LET A=A-P
1920 IF R1=0 THEN 1960
1930 IF R1<1 THEN 1950
1940 LET R1=R1/100
1950 LET R=R1
1960 NEXT G9
1970 LET T6=3
1971 LET U(0)=U(0)+3
1972 CHANGE U TO S3$
1973 PRINT S3$
1975 GOTO 1170
1980
1990 IF D2<=D THEN 99992
2000 LET A9=FND(D4)
2010 IF G9>1 THEN 2120
2015 IF D0<>0 THEN 2120
2110 GOTO 2130
2120 LET D3=D2-D
2130 LET I7=D3*R*A/360
2140 IF P$="NO" THEN 2190
2150 LET A9=FNM(M8,D8,Y8)
2160 PRINT TAB(12);
2170 LET A9=FNM(M,D5,Y)
2180 PRINT TAB(22); D3; TAB(26);
2190 LET P=FNP(P)
2200 IF P$="NO" THEN 2220
2210 PRINT TAB(36);
2220 LET A=FNP(A)
2230 IF P$="NO" THEN 2250
2240 PRINT TAB(48); R*100; TAB(54);
2250 LET I7=FNP(I7)
2260 LET I=I+I7
2270 LET I4=I4+I
2280 LET B3=B3+A
2290 IF P$="NO" THEN 1170
2300 LET U(0)=S3+N4-G9
2310 CHANGE U TO S3$
2320 PRINT S3$
2330 PRINT"INTEREST DUE = ";
2340 LET I=FNP(I)
2350 PRINT
2360 LET T6=0
2370 PRINT"BALANCE OUTSTANDING = ";
2380 LET A=FNP(A)
2390 GOTO 1170
2400 PRINT""
2410 LET P$="YES"
2415 PRINT"TOTAL INTEREST DUE =";
2420 LET I4=FNP(I4)
2430 PRINT
2440PRINT"TOTAL BALANCE OUTSTANDING = ";
2450 LET B3=FNP(B3)
2460 STOP
2470
2480 DATA 9
2490 DATA 70168
2500 DATA 3,3,3
2510 DATA 31,28,31,30,31,30,31,31,30,31,30,31
2520 DATA DARTMOUTH NATIONAL BANK
2600 DATA 1111
2601 DATA WILLIAM SMITH
2602 DATA "34 LEBANON STREET"
2603 DATA "HANOVER, N.H. 03555"
2604 DATA 0
2605 DATA 8000,7.75
2606 DATA 60168,0,8
2607 DATA 60668,50,8
2608 DATA 62068,100,8.5
2609 DATA 0
2610 DATA 0,END
99992 PRINT"ERROR--LAST PAYMENT WAS MADE IN THE FUTURE."
99993 GOTO 1170
99994 PRINT"ERROR--SUSPECT PAYMENTS WERE NOT IN CHRONOLOGICAL ORDER."
99995 GOTO 1170
99996 LET D3=90
99997 LET D0=D
99998 GOTO 1290
99999 END