I am working on a programming assignment for my data structures class and we are working on making a statistician class. One of the functions that we have to have is to be able to take a statistician list (count, sum, min, max and mean) and multiply it by a certain integer. Below is what i have so far for the specific function. However, i am lost about where to go as it seems to be worng.
statistician operator *(double scale, const statistician& s)
{
scale*s;
return s;
}
Attached is the .h file that explains what i am trying to do. i am writing the implementation file for this .h file and am trying to figure how to write the statistician operator* that is defined in the comments of the .h file
http://www.cs.colorado.edu/%7Emain/projects/stats.h
Thanks for any help
You are trying to create a copy of the class statistician, but scaled by scale. Something like
The member function scaleBy would multiply the appropriate member variables by the appropriate scale.
You wouldn’t scale the count. If you had something like variance in your statistician class, you would probably multiply it by the square of scale.