Lab to be performed in Java.
Lab:
1.) Write a class named TestScores. The class constructor shouldaccept an array of test scores as its argument. The class shouldhave a method that returns the average of the test scores. If anytest score in the array is negative or greater than 100, the classshould throw an IllegalArgumentException. Write a driver class totest that demonstrates that an exception happens for thesescenarios
2.) Write a class named InvalidTestScore by reusing the code inTestScores class you wrote for 1) so that it throws anInvalidTestScore exception. Write a driver class to test thatdemonstrates that an exception happens for these scenarios.
Note 1) and 2) are two separate programs that must be handed inas well as your test score array.
---- Create a class TestScores and TestScoresconstructor should accept an array of test scores as its argument.Users will enter 5 test scores use a scanner toget input from the console.
---- Create a method that returns or print toconsole the correct average of the test scores. If any test scorein the array is negative or greater than 100, the class shouldthrow an IllegalArgumentException.
---- Create a class InvalidTestScore by reusingthe code of TestScores that print to console the line “Test scorevalues should not be greater than 100 or negative†whenIllegalArgumentException is thrown.