Write a class “Student” that has the following:
- Private instance variables - “ID” of type integer. - “name” of type String. - “numCourses” of type integer. - “scores” an array of integers with the size “numCourses”.
- Constructor that initializes student ID, name, and the number of courses.
- Void method “fillScores” that asks the user to enter the student scores and store them in the “scores” array. This method should handle the InputMismatchException.
- Integer method “getOneScore” takes an index of the student score and returns its value. This method should handle the ArrayIndexOutOfBoundsException.
- Void method that prints all information of the student. In the deriver class, define an object of the Student class and test its functionalities. The program output may be as the following:
output example:
--------------
Enter score
90
Enter score
80
Enter score
70
Enter score
60
Enter score
50
Enter index to get its score
3
60
Student Information
ID: 123
Name: Ahmed
Number of courses: 5 90 80 70 60 50
=================
Enter score
90
Enter score
80
Enter score
70
Enter score
test
java.util.InputMismatchException
Enter score
60
Enter index to get its score
999
java.lang.ArrayIndexOutOfBoundsException: 999
-1
Student Information
ID: 123
Name: Ahmed
Number of courses: 5 90 80 70 0 6