	SUBROUTINE MEAN(A,FM)
	DIMENSION A(500)
	LOGICAL*1 Y(3)
	REWIND 1
C	THE NEXT SEVEN STATEMENTS COUNT THE NUMBER OF DATA POINTS
C	AND SUM THE DATA VALUES OVER N.
	S=0
	N=0
4	N=N+1
	READ(1,5,END=10)A(N)
5	FORMAT(1X,F10.4)
	S=S+A(N)
	GO TO 4
10	N=N-1
	FM=S/N
	WRITE(5,15)FM
15	FORMAT(1X,' THE MEAN=',F10.4)
17	WRITE(5,20)
20	FORMAT(1X,' DO YOU WANT A HARD COPY OF THE MEAN, YES/N0  '$)
	READ(5,30)(Y(J),J=1,3)
30	FORMAT(3A1)
	IF(Y(1).EQ.'Y') GO TO 35
	IF(Y(1).EQ.'N') GO TO 45
	WRITE(5,33)
33	FORMAT( ' ERROR. TRY AGAIN.')
 	GO TO 17
35	WRITE(6,40)FM
40	FORMAT(1X,' THE MEAN=',F10.4)
45	RETURN
	END
