I'm having trouble working on my data structure programming project!!
I have to implement the statistician class but the operator overloading part is a problem!!
This is the header file!!
#include <iostream>
namespace main_savitch_2C
{
class statistician
{
public:
// CONSTRUCTOR
statistician( );
// MODIFICATION MEMBER FUNCTIONS
void next(double r);
void reset( );
// CONSTANT MEMBER FUNCTIONS
int length( ) const;
double sum( ) const;
double mean( ) const;
double minimum( ) const;
double maximum( ) const;
// FRIEND FUNCTIONS
friend statistician operator +
(const statistician& s1, const statistician& s2);
friend statistician operator *
(double scale, const statistician& s);
private:
int count; // How many numbers in the sequence
double total; // The sum of all the numbers in the sequence
double tinyest; // The smallest number in the sequence
double largest; // The largest number in the sequence
};
// NON-MEMBER functions for the statistician class
booloperator ==(const statistician& s1, const statistician& s2);
}