Question: /** * Code for E7.9 * This class computes various statistics from a set of data values in an array. * @author */ public class

 /** * Code for E7.9 * This class computes various statistics

from a set of data values in an array. * @author */

/** * Code for E7.9 * This class computes various statistics from a set of data values in an array. * @author */ public class DataSet { private double[] data; private int dataSize; private int maximumNumberOfValues;

/** Constructs an empty data set. @param maximumNumberOfValues the maximum this data set can hold */ public DataSet(int maximumNumberOfValues) { data = new double[maximumNumberOfValues]; }

/** Adds a data value to the data set if there is a room in the array. @param value a data value */ public void add(double value) { // Complete this method. Don't forget to ignore the input if the array is full. . . . }

/** Gets the sum of the added data. @return sum of the data or 0 if no data has been added */ public double getSum() { // Complete this method . . . }

/** Gets the average of the added data. @return average of the data or 0 if no data has been added */ public double getAverage() { // Complete this method . . . }

/** Gets the maximum value entered. @return maximum value of the data NOTE: returns -Double.MAX_VALUE if no values are entered. */ public double getMaximum() { // Complete this method . . . } }

Please use the template provided above using intermediate java.

E7.9 Write a class DataSet that stores a number of values of type double. Provide a constructor public DataSet(int maximumNumberOfValues) and a method public void add (double alue) Practice Exercises 36 that adds a value, provided there is still room Provide methods to compute the sum, average, maximum, and minimum value

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!