I am getting an error when I try to run my mode median mean program. What is causing this error.
Mode.h:41:29: error: no matching function for call to ‘Mode::Mode()’
Mode.h:19:5: note: candidates are: Mode::Mode(int*, int)
Mode.h:10:12: note: Mode::Mode(const Mode&)
class Mode {
protected:
int *b;//Sorted Array
int bSize;//Size of Sorted Array;
int max_Freq;//Frequency of the mode set,
int num_Modes;//Number of Modes, size of Mode Array
int *m;//Mode Array
int *mark_Sort(int *,int);//Utility function for the class
public:
Mode(int *pList, int nCount) // understand this is legal, this is the default constructor
{
// init things here but don't run anything.
};
// Mode(int *,int); // this is not.
~Mode(){//Constructor inputing the initial
delete []b;
delete []m;
}
};
class Statistics:public Mode{ //This the line of error
protected:
double sum;//Stores the sum of the array
double average;//Stores the average of the sum of array
int middle;//Store number of the array
float median;
public:
Statisticts(int *pList, int nCount) // default constructor
: Mode(pList, nCount)
{
// init the things specific to Statsticts here no function calls, just init varialbles
}
int set_Mean()const{
}
double get_Mean()const{
return average;
}
int set_Median()const{
}
int get_Median()const{
return median;
}
};
int main()
{
int *pMylist;
int nCount = 100;
pMyList = newint(nCount);
for(int nIndex = 0; nIndex <100; nIndex++)
{
pMyList[nIndex] = nIndex;
}
Mode myMode(pMyList, nCount); // this should just populate the object.
// this is the first function on the object I want to run, ok so it copies data from one point to another.
myMode.useData();
// report what you found.
myMode.ReportData();
Statistics myStat(pList, nCount); // does what it needs in the mode constructor to init variables.
MyStat.MessageVariables(); // local to stat may just call UseData() and other massaging functions..
myStat.set_Median(); // stat function...
myStat.set_Mean(); // stat function.
// should run the destructors here.
return 0;
// exit code;
};