public static void main(String[] args) {
		
		int nLines = 0;
		double sum = 0;
		
		try {
			FileReader fr = new FileReader("invoer.txt");
			BufferedReader br = new BufferedReader(fr);
			
			while (true) {
				String line = br.readLine();
				
				if (line == null)
					break;
				nLines++;
				
				Double waarde = Double.parseDouble(line);
				sum += waarde;
				System.out.println("" + waarde);
			}
			br.close();
			System.out.println("Er staan " + nLines + " getallen in de file");
			System.out.println("Het gemiddelde is: " + (sum / nLines));
		} catch (Exception e) { e.printStackTrace(); }
	}