10 PRINT "EARNED INTEREST TABLE"
20 PRINT
29 REM - STATEMENTS 30 TO 230 REQUEST USER INPUT
30 PRINT "PRINCIPAL";
40 INPUT P
50 PRINT "NOMINAL INTEREST RATE";
60 INPUT I
69 REM - CONVERT PERCENT TO DECIMAL
70 I=I/100
80 PRINT "NUMBER OF DEPOSITS/WITHDRAWALS PER YEAR";
90 INPUT N1
99 REM - DON'T ASK FOR AMOUNT IF FREQUENCY IS ZERO
100 IF N1=0 THEN 160
108 REM - DEPOSITS ARE ENTERED AS A POSITIVE NUMBER
109 REM - WITHDRAWALS ARE ENTERED AS A NEGATIVE NUMBER
110 PRINT "AMOUNT OF DEPOSIT/WITHDRAWAL";
120 INPUT R
129 REM - INTEREST IS COMPOUNED DAILY
130 N=360
139 REM - PRINT AT EACH DEPOSIT/WITHDRAWAL 
140 L2=N1
150 GOTO 200
160 PRINT "NUMBER OF COMPOUNDING PERIODS PER YEAR";
170 INPUT N
180 N1=0
189 REM - PRINT FOUR TIMES PER YEAR
190 L2=4
200 PRINT "START WITH WHAT YEAR";
210 INPUT X
220 PRINT "END PRINTING WITH WHAT YEAR";
230 INPUT Y
239 REM - START PRINTING AT THE BEGINNING OF A YEAR
240 X=INT (X)
249 REM - INITIATE RUNNING TOTALS
250 B0=P
260 I1=0
270 I2=0
280 I3=0
290 K=66
300 P1=4
310 FOR J0=1 TO INT(Y) +1
319 REM - START PRINTING?
320 IF J0<X THEN 480
329 REM - TEST FOR END OF PAGE
330 IF K<55 THEN 470
339 REM - SPACE TO NEXT PAGE,PRINT HEADINGS (ASSUMED 66 LINE PER PAGE)
340 FOR K1=K TO 66
350 PRINT
360 NEXT K1
370 K=6
380 PRINT "                      EARNED INTEREST TABLE"
390 PRINT "  PRINCIPAL $";P;"     AT";I*100;"% NOMINAL     FOR";Y; "YEARS"
399 REM - SKIP DEPOSIT/WITHDRAWAL HEADING IF THERE ARE NONE
400 IF N1=0 THEN 430
410 PRINT "REGULAR DEPOSIT/WITHDRAWAL $";R;"     ";N1;" TIMES PER YEAR"
419 REM - K COUNTS THE NUMBER OF PRINTED LINE PER PAGE
420 K=K+1
430 PRINT "     EFFECTIVE INTEREST RATE";FNR(100*((1+I/N)[N-1));"% PER YEAR"
440 PRINT 
450 PRINT "YEAR","BALANCE","INTEREST","ACCUM INTEREST"
459 REM - CALCULATE INTEREST
460 PRINT 
469 REM - PRINT YEAR NUMBER
470 PRINT J0,
480 L1=1
490 N2=1
500 P2=1
510 FOR J1=1 TO N
519 REM - DEPOSIT/WITHDRAW ANY MORE THIS YEAR?
520 IF N2>N1 THEN 560
529 REM - TIME TO MAKE DEPOSIT/WITHDRAWAL?
530 IF N2/N1>J1/N THEN 560
539 REM - CALCULATE NEW BALANCE
540 B0=B0+R
549 REM - COUNT DEPOSIT/WITHDRAWALS MADE PER YEAR
550 N2=N2+1
560 B2=B0*(1+I/N)
569 REM - I1=AMOUNT INTEREST WITH EACH COMPOUNDING PERIOD
570 I1=B2-B0
579 REM - I3=AMOUNT INTEREST ACCUMULATED BETWEEN POSTING
580 I3=I3+I1
589 REM - I2=TOTAL INTEREST ACCUMULATED TO DATE
590 I2=I2+I1
599 REM - ROUND AT INTEREST POSTING TIME
600 IF P2/P1>J1/N THEN 640
610 I2=FNR(I2)
620 B2=FNR(B2)
630 P2=P2+1
639 REM - YEAR TO START PRINTING?
640 IF J0<X THEN 710
649 REM - TIME TO PRINT A LINE?
650 IF J1/N<L1/L2 THEN 710
660 L1=L1+1
670 PRINT FNR(B2),FNR(I3),FNR(I2)
679 REM - INTEREST POSTED, REINIALIZE INTEREST ACCUM  BETWEEN POSTINGS
680 I3=0
690 K=K+1
699 REM - YEAR NUMBER PRINTED WITH FIRST POSTING IN EACH YEAR ONLY
700 PRINT
710 B0=B2
719 REM - NO MORE LINES TO PRINT IN LAST YEAR?
720 IF J0+J1/N-1>=Y THEN 780
730 NEXT J1 
739 REM - START PRINTING?
740 IF J0<X THEN 770
750 PRINT 
760 K=K+1
770 NEXT J0
780 PRINT
789 REM - RESTART OR END PROGRAM?
790 PRINT "CHANGE DATA AND RECOMPUTE? (1=YES, 0=NO)";
800 INPUT Z 
810 PRINT 
820 IF Z=1 THEN 20 
829 REM - ROUND OFF FUNCTION
830 DEF FNR(X)=INT(X*100+.5)/100
840 END
