You will implement a new class called Statistician, the specification (most of which is written for you) and the implementations for the class specification which you must finish . The Statistician is a class that is designed to keep track of simple statistics about a sequence of real numbers. There are two member methods that you should understand at an informal level before you proceed any further. The prototypes for these two functions are shown here as part of the Statistician class declaration:As indicated above,public double mean( )
{
// The student's code will replace this return statement:
return 0.0;
}public void next(double number)
{
}
Be careful about how you set the private member variable that keeps
track of the smallest number. My suggestion is that you do NOT have the
constructor initialize this member variables (because when the constructor
does its work, there have not yet been any numbers, so there is no smallest
number). But part of the work of the "next" function is to correctly maintain
the private member variables. This means that the first time that the next
function is called, it should set the private member variable that keeps
track of smallest values. Later, if next is called again with a smaller
number, then the next function will change the member variable that is
keeping track of the smallest value. (You'll have a similar process for
the member variable that's keeping track of the largest value).
modified by Rick Denman to use JUnit for testing