Question: JAVA Write a class called Statistics that does basic statistical functions such: computing the average value ( mean ) Getting the span of values over

JAVA
Write a class called Statistics that does basic statistical functions such:
computing the average value (mean)
Getting the span of values over which your data set occurs (range
computing the midpoint between the lowest and highest value of the set (median)
computing the maximum
computing the minimum
Implement the following constructors and instance methods as listed below:
public Statistics()- Constructor method to set set your list of values to default as an empty list
public Statistics(ArraysList vals)- A constructor that takes a list of values to set your list data structure for computing statistics.
public void add(int val)- add the parameter to the member field
public void add(ArraysList vals)- Add the values in the provided arraylist to the list data structure for computing stats
public int getAverage()- returns the average of the values in the list
public int getMaximum()- returns the maximum of the values in the list
public int getMinimum()- returns the minimum of the values in the list
public int getMedian()- returns the median value in the list.
public int getRange - returns the range of the values in the list
public void clear()- set all member fields default values.

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!