Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 StatisticsArraysList vals A constructor that takes a list of values to set your list data structure for computing statistics.
public void addint val add the parameter to the member field
public void addArraysList 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started