subject
Computers and Technology, 26.02.2021 20:20 jr294

Write a class named TestScores. The class constructor should accept an array of test scores as its argument. The class should have a method that returns
the average of the test scores. If any test score in the array is negative
or greater than 100, the class should throw an IllegalArgumentException.

Demonstrate the class in a program (create a Driver class in the same file).
The program should ask the user to input the number of test scores to be counted,
and then each individual test score. It should then make an array of those scores,
create a TestScore object, and print the average of the scores.

If an IllegalArgumentException is thrown, the main method should catch it, print "Test scores must have a value less than 100 and greater than 0." and terminate the program.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
You know the right answer?
Write a class named TestScores. The class constructor should accept an array of test scores as it...
Questions
question
English, 09.02.2021 21:50
question
Mathematics, 09.02.2021 21:50
question
Chemistry, 09.02.2021 21:50
question
Mathematics, 09.02.2021 21:50
question
Business, 09.02.2021 21:50
question
Business, 09.02.2021 21:50