My class header file looks like this:
#pragma once
// Define RateType Variable
enum RateType {LiveInWorkIn, LiveOutWorkOut, LiveOutWorkIn, LiveInWorkOut};
class GRTax
{
public:
float CGRTax(RateType, float);
float CGRTax();
float SetRate(RateType);
float mTaxableIncome(void);
float mTaxRate(void);
RateType mRate(void);
GRTax(void);
~GRTax(void);
};
and the code from my .cpp file that has the error.
float GRTax::SetRate(RateType)
{
int Selection;
cout << "Please choose:\n";
cout << "1 for LiveInWorkIn\n";
cout << "2 for LiveOutWorkOut\n";
cout << "3 for LiveOutWorkIn\n";
cout << "4 for LiveInWorkOut\n";
cin >> Selection;
switch (Selection) {
case 1:
mTaxRate= .016; // this is the line that has the error
break;
case 2:
mTaxRate= 0; // this is the line that has the error
break;
case 3:
mTaxRate= .006; // this is the line that has the error
break;
case 4:
mTaxRate= .006; // this is the line that has the error
break;
return mTaxRate;
}
}