public class Stuff { // arrays to hold distinct measurement values and associated // number of times each occurs int [] freq; int [] measurements; // logical size of arrays int Number; // default constructor public Stuff() { freq = new int[10]; measurements = new int[10]; Number = 0; } // Method that is passed a measurement (value) and // returns the index corresponding to the cell in // in which the measurement is store, or -1 public int search (int value) { return 0; } // Method to insert a measurement (value). Keep in mind // there are two cases, value is already stored in measurements // in which case you want to increment the corresponding // freq, or // value is not stored in which case you want to // insert value into measurements and initialize // freq. (REMEMBER the method search() // above.) public void addNew(int value) { } // Method to compute the average weighted sum of the // entries stored: the average of the following values // freq[0]*measurements[0], ..., freq[Number-1]*measurements[Number-1] public double weightedaverage() { return 0.0; } }