Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions