Sep 29, 2009 at 8:16pm UTC
Can an expert help me with the rest of this .cpp file?
Is what I have so far correct?
Sep 29, 2009 at 8:56pm UTC
The employee class has no member called monthlySalary - it is called salary
See line 18 of the header file.
personally I think :
1. The salary should be double rather than an int.
2. you might want to avoid 0 as a salary
because you don't want to end up doing integer division, and you certainly don't want to divide by 0
Sep 29, 2009 at 9:01pm UTC
It is Generally recommended not to use using namespace xxx directive in header files.
Do it the same way as you have done in the cpp file - or write it out fully like std::cout
Sep 29, 2009 at 9:04pm UTC
the task also says:
Constructor should have 3 parameters.
I think they want a constructor with parameters for firstname, lastname and salary.
Your current constructor has only one parameter.
Sep 29, 2009 at 9:58pm UTC
Would my constructor be:
void Employee::setsalary( int salary, string FirstName, string LastName)
?
Also, would it be salary = salary;
?
Do I add 10% after setting the salary?
would it be cout << "monthly salary is now (salary*.1)" << endl;