      PROGRAM FAIL
************************************************************************
* Program to read a list of failure times, calculate the mean time to  *
* failure, and then print a list of failure times that are greater     *
* than the mean.  Identifiers used are:                                *
*     FAILTM  :  one-dimensional array of failure times                *
*     LIMIT   :  parameter:  size of the array                         *
*     NTIMES  :  number of failure times to be processed               *
*     I       :  subscript                                             *
*     SUM     :  sum of failure times                                  *
*     MEANFT  :  mean time to failure                                  *
*                                                                      *
* Input:  NTIMES and a list of NTIMES failure times                    *
* Output: MEANFT and a list of failure times greater than MEANFT       *
************************************************************************

      INTEGER LIMIT, NTIMES, I
      PARAMETER (LIMIT = 50)
      REAL FAILTM(LIMIT), SUM, MEANFT
      INTEGER NTIMES, I

* Read the failure times and store them in array FAILTM

      PRINT *, 'HOW MANY FAILURE TIMES ARE TO BE PROCESSED?'
      READ *, NTIMES
      PRINT *, 'ENTER THE FAILURE TIMES, AS MANY PER LINE AS DESIRED'
      READ *, (FAILTM(I), I = 1, NTIMES)

* Calculate the mean time to failure

      SUM = 0
      DO 10 I = 1, NTIMES
         SUM = SUM + FAILTM(I)
 10   CONTINUE
      MEANFT = SUM / REAL(NTIMES)
      PRINT 100, NTIMES, MEANFT
 100  FORMAT(// 1X, I3, ' FAILURE TIMES WITH MEAN =', F6.1)

* Print list of failure times greater than the mean

      PRINT 101
 101  FORMAT(// 1X, 'LIST OF FAILURE TIMES GREATER THAN THE MEAN:')
      DO 20 I = 1, NTIMES
         IF (FAILTM(I) .GT. MEANFT) THEN
            PRINT 102, FAILTM(I)
 102        FORMAT(1X, F9.1)
         END IF
 20   CONTINUE
      
      END
