Question: Part 0 1 - Compute Average For this part you must write a public static method named getAverage. This method will take an ArrayList as

Part 01- Compute Average
For this part you must write a public static method named getAverage. This method will take an ArrayList as an argument, and it will return (as a double) the average of all the values in the Arraylist. Remember that to compute the average of a list of values, you will need to first get the sum (total) of all the values, and then divide by the count (the number of values in the list).
After you have finished wring this method, Run your code to find and then fix any syntax errors. You may also wish to write some other code (in the main method) to call and test your method(s). When you are confident that your method is structurally and logically correct, then submit your code to the auto-grader for feedback. Your code should pass Structure test 1 and Logic tests 1.1 and 1.2 before you continue.
Part 02- Find Min
For this part you must write a public static method named getMin. This method will take an ArrayList as an argument, and it will return (as a double) the minimum of all the values in the Arraylist. Remember that to find the minimum of a list of values, you will need to search through the list and keep track of the smallest value you have seen so far.
After you have finished wring this method, Run your code to find and then fix any syntax errors. You may also wish to write some other code (in the main method) to call and test your method(s). When you are confident that your method is structurally and logically correct, then submit your code to the auto-grader for feedback. Your code should pass Structure test 2 and Logic tests 2.1 and 2.2 before you continue.
Part 03- Find Max
For this part you must write a public static method named getMax. This method will take an ArrayList as an argument, and it will return (as a double) the maximum of all the values in the Arraylist. Remember that to find the maximum of a list of values, you will need to search through the list and keep track of the largest value you have seen so far.
After you have finished wring this method, Run your code to find and then fix any syntax errors. You may also wish to write some other code (in the main method) to call and test your method(s). When you are confident that your method is structurally and logically correct, then submit your code to the auto-grader for feedback. Your code should pass Structure test 3 and Logic tests 3.1 and 3.2 before you continue.
Part 04- Center Data
For this part you must write a public static method named center. This method will take an ArrayList as an argument, and it will have no return value. To center the data, you must subtract the average from each value in the list.
For example, given this data {1.00,2.00,3.00,4.00,5.00}, the average is 3.00; when we subtract this average from each value in the list, the list will now look like this {-2.00,-1.00,0.00,1.00,2.00}
Note that this method does not need to return anything , because it will be directly editing the values in the ArrayList that is passed (by reference) as an argument to the method.
After you have finished wring this method, Run your code to find and then fix any syntax errors. You may also wish to write some other code (in the main method) to call and test your method(s). When you are confident that your method is structurally and logically correct, then submit your code to the auto-grader for feedback. Your code should pass Structure test 4 and Logic tests 4.1 and 4.2 before you continue.
Part 05- Scale Data
For this part you must write a public static method named scale. This method will take an ArrayList and a double as arguments, and it will have no return value. The first argument (the ArrayList) will contain the list of values to scale, and the second argument (the double) will be the new range. To scale the data, you must do the following:
compute the current range of the data in the argument ArrayList. The range is the max value in the list minus the min value in the list.
compute the scale factor needed to re-scale the data. The scale factor will be the new range divided by the current range
scale each value in the list. To scale a value, you multiply the value by the scale factor.
For example, given

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 Programming Questions!