import java.util.Scanner;
import java.io.*;
public class Assignment14C
{
	public static void main (String[] args)
	{
			File textFile= new File("U:\\numbers.dat");
			FileReader in;
			BufferedReader readFile;
			String score;
			double average,total=0;
			int number=0;			
	
			try
			{             in = new FileReader(textFile);
				readFile= new BufferedReader(in);
				while((score=readFile.readLine())!=null)
				{             number++;
					System.out.println(score);
					total=total+Double.parseDouble(score);
				}
			    average =total/number;
				System.out.println("Average= "+average);
				readFile.close();
				in.close();	
			}
			catch (FileNotFoundException e )
			{             System.out.println(" File does not exist");
				System.err.println("FileNotFoundException :"+ e.getMessage());
			}
			catch (IOException e)
			{             System.out.println(" Problem reading file");
				System.err.println("IOException :"+ e.getMessage());
			}
	}
}
