Question: Design and implement a program that utilizes an exception class called ScoreNotValidException, designed to be thrown when an exam score is not valid. An exam

Design and implement a program that utilizes an exception class called ScoreNotValidException, designed to be thrown when an exam score is not valid. An exam score must be a non-negative integer less then or equal to 100. In the main driver of the program, read numbers from the user until the user enters -1. If a score is entered that is not valid, say less than 0 or more than 100, throw the exception. The program should catch and handle the exception if it is thrown. Handle the exception by printing an appropriate message, and then continue processing more scores by finding the largest score entered. After user enters -1, the program prints this largest exam score on the screen. public class ScoreNotValidException extends Exception public ScoreNotValidException(String message) { super(message);} }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
