public static void main(String[] args) throws FileNotFoundException {
		File f = new File("grades.txt");
		Scanner scan = new Scanner(f);

		FileOutputStream fos = new FileOutputStream("answer.txt", false);
		PrintWriter pw = new PrintWriter(fos);

		ArrayList<Integer> grades = new ArrayList<Integer> ();

		while (scan.hasNext()) {
			grades.add(scan.nextInt());
		}

		try {
			pw.printf("The average of the grades is: %f\n", getAverage(grades));
		}
		
		catch (BadGradeException bge) {
			System.out.println("There was silly input in the grades file! :O");
		}

		scan.close();
		pw.close();

	}