$NODEBUG
$STORAGE:2
$FLOATCALLS
C THIS EXAMPLE WILL CALCULATE HOW LONG IT WILL TAKE TO BE FLAT BROKE
C (LESS THAN 1 PENNY) IF I START WITH $5.00 IN MY SAVINGS ACCOUNT
C GIVE MYSELF 15.25% ANNUAL INTEREST AND EVERY SEVENTH DAY
C REMOVE 1% OF THE MONIES IN MY ACCOUNT.
       PROGRAM DEMO
$MESSAGE:'THIS IS VISIBLE IN FOR1 PASS'
C N WILL BE MY COUNTER FOR THE NUMBER OF DAYS MY ACCOUNT IS OPEN
       N = 1
C $5.00 IS MY STARTING BALANCE
       X = 5.00
C I WILL BE COMPOUNDING INTEREST DAILY AT THE RATE OF 15.25% ANNUALLY
10     X = (1.0 + (.1525/365.0))*X
       N = N+1
       IF (MOD(N,7) .EQ. 0) CALL DEDUCT(X)
       IF (X .LT. .01) THEN
	  WRITE(*,'('' NUMBER OF DAYS TO BECOME FLAT BROKE'',I8)')N
          WRITE(*,'('' I NOW HAVE IN MY ACCOUNT'',F9.7,''  CENTS'')')X
	  STOP
       ENDIF
       GOTO 10
       END


C THIS SUBROUTINE WILL JUST REDUCE THE AMOUNT IN MY ACCOUNT BY 1% WEEKLY
       SUBROUTINE DEDUCT(A)
       A = .99*A
       RETURN
       END
