a. Create a Score Exception class that extends Exception and whose constructor accepts a String parameter and
Question:
a. Create a Score Exception class that extends Exception and whose constructor accepts a String parameter and passes it to the Exception class constructor. Save the file as ScoreException.java.
b. Write an application in which you store at least five student ID numbers in an array. One at a time, display the ID number and prompt the user to enter a test score for the student. Catch any Exception thrown if the user does not enter an integer for the score, display an error message, and set the score to 0. Throw a Score Exception if the user enters a score greater than 100. Catch the Score Exception, display an appropriate message, and then store a 0 for the student’s score. At the end of the application, display all the student IDs and scores. Save the file as TestScore.java.
Step by Step Answer: