The code to use for the changes for the Test Score application is :
Change the while statement in the main method to only end when the user enters 999:
Java
while (score != 999) {
if (score > 100 || score < 0) {
System.out.println("Invalid entry; not counted");
} else {
scores[scoreCount++] = score;
}
System.out.print("Enter next test score (enter 999 to quit): ");
score = scanner.nextInt();
}
2. to add an error message if the user enters a score greater than 100 but not 999 use the code below
Java
if (score > 100 && score != 999) {
System.out.println("Invalid entry; not counted");
} else {
scores[scoreCount++] = score;
}