Question: TestScores Class - Java Programming Write a class named TestScores. The class constructor should accept an array of test scores as its argument. The class

TestScores Class - Java Programming

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.

TestScores Class - Java Programming Write a class named TestScores. The classconstructor should accept an array of test scores as its argument. Theclass should have a method that returns the average of the testscores. If any test score in the array is negative or greater

You will need to create a TestScores constructor that accepts an array of Scores. The constructor will contain the throw for any scores less than O or greater than 100 TestScores will also contain a getAverage method Ele Edit Scurce Refactor Navigate Segrch Project Run Window Help Quick Access :l E J Java ?????? D Backwardstri. D PassfailExam. D courseGrade.. a TestScores. X 0 TestScorestava "n e- Package Explorer CISS238 D CourseGrade.. Task List 1 package chapterl8 4Testscores class Demo Progran Chapter 1e, Programming Challenge 1 7 public class TestscoresDeno ( Find All Ativate D chapter1 ? chapter10 public static void main(String[] args) { chapter2 ?chapter3 Chapter4 D chapter5 I>?chapter6 / Below are the arrays to test renove one at a tine to test double[] Scores-(97.5, 66.7, 88.?, 100.0, 99.8); /Idoublef scores-(97.5, 66.7, 88.0, 181., 99. //double[] Scores(97.5, 99.7 /Idouble) Scores - (97.5, 18) Dchapterd beek ??} chapter7 b" chapter78 , chapter9 chapter7 boek D Connect Mylyn /I try to create a TestScores object initialized with Scores Connest to your task and ALM tools or create local task ??IT145 b??IT1458 Systen.out.println("The average of the scores is Outline M + t.getaverageC)) BJRE System Library JlavaSE-1.8 catch (IllegalArgumentException e) Systen.out.printin nvalid score found. n" e.getlessage()); TestScore Demo 27 ?Problems @Javedoc?Declaration?Console X No consoles to display at this time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!