Jan 29, 2009 at 11:59pm UTC
Okay... I'm going crazy here...
Here is my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Salaried::Salaried(double _weeklySalary, int _num, string _name, string _address, string _phNum, string _ssn)
:Employee(_num, _name, _address, _phNum, _ssn)
{
weeklySalary = _weeklySalary;
}
double calcSalary()
{
double salaryTotal;
double federal = .20;
double state = .075;
double benefits = .0524;
weeklySalary = weeklySalary - ((weeklySalary*federal) + (weeklySalary*state) + (weeklySalary*benefits)); //It says undefined on this line!
return weeklySalary;
}
Someone tell me why my compiler is saying that weeklySalary is undefined... It's properly declared in my header file and if I comment out everything in my calcSalary function, the program executes flawlessly...
Please help!
Last edited on Jan 30, 2009 at 12:03am UTC
Jan 30, 2009 at 12:07am UTC
double calcSalary()
should be double Salaried::calcSalary()
if it's part of that class.
Jan 30, 2009 at 12:09am UTC
Oh... Wow... I should make fun of myself for that one... Thanks!