import java.io.*; public class ScoreAverage1 { public static void main(String[] args) { String line; int sum = 0; int count = 0; try (BufferedReader br = new BufferedReader(new FileReader("score_empt.txt"))) { while ((line = br.readLine()) != null) { sum += Integer.parseInt(line); count++; } double average = (double) sum / count; System.out.println("Average score: " + average); } catch (NumberFormatException e) { System.out.println("Invalid number format in file: " + e.getMessage()); } catch (FileNotFoundException e) { System.out.println("File not found: " + e.getMessage()); } catch (IOException e) { System.out.println("An error occurred: " + e.getMessage()); } } }