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

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 Solution

3.39 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a b public class S... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!