Question: The class names are: Assignment AssignmentTest AssignmentDriver **Regarding the comment - I'm not sure what other information you are looking for. The following is a

The class names are:

Assignment

AssignmentTest

AssignmentDriver

**Regarding the comment - I'm not sure what other information you are looking for.

The following is a mini-lab that will help you master accessors, mutators, constructors, and testing. In this mini-lab you will build a test class, the class to test, and a driver class that is a program that can be run. The following is the specification:

A new class constant (public, static and final) in Assignment called MAX_SCORES that is set to 15.

A new instance variable in Assignment that is an integer array to hold all the scores that are accrued.

The accrueScore() method may now only accrue up to MAX_SCORES total scores. Attempting to add more scores will result in latter scores being ignored.

A getScoreList() accessor method that returns a string holding a comma-separated list of the scores that have been accrued.

A getStdDev() accessor method that returns the standard deviation of all the scores according to the following formula:

Where N is the count of scores accrued,  The class names are: Assignment AssignmentTest AssignmentDriver **Regarding the comment - is the average score, and xi is the ith score in the array of scores.

For example, if the scores 120, 100, 130, and 145 have been entered, first calculate the average of the scores as 123.75. Then sum the squares of the differences between each element of the array and the mean: (120-123.75)2 + (100-123.75)2 +(130-123.75)2 +(145-123.75)2 = 1068.75. Finally, divide that number by the count and take the square root: = 16.35.

You will be modifying your Assignment, AssignmentTest, and AssignmentDriver classes.

Create test cases to AssignmentTest that will thoroughly exercise the two new methods requested.

Make the changes to the Assignment class according to the specification given.

Modify your AssignmentDriver (the main method) such that the new statistics are generated and printed.

Now rewrite the Assignment class so that it uses an ArrayList of integers instead of an array. You will no longer need the MAX_SCORES constant singe ArrayList objects can grow to accommodate as many scores as you will be willing to enter. You also wont need the count of scores entered because the size() of the array list can do that for you.

Make the changes to the Assignment class to use an ArrayList.

i=1 i=1

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!