Not sure why I am getting errors. |
What sort of errors? If there are compiler errors which you don't understand, post the text of the message here for someone to look at.
At a glance, there are a few things in the code which look wrong, for example here:
1 2 3 4 5 6
|
//void will get the the gross pay
void getPay(double g)
{
grossPay = g;
return grossPay;
}
|
A function declared as void cannot return a value. If it is to return a double, make it a type double rather than void.
Also, in that and other functions, it is puzzling why there is an input parameter g to the function, and why it is actually setting the value of grossPay.
There are similar questions regarding the other get functions.
For example the function
1 2 3 4 5
|
double getHours(double h)
{
hours = h;
return hours;
}
|
should look more like this:
1 2 3 4
|
double getHours() const
{
return hours;
}
|
It is declared as const to indicate to both the reader and to the compiler that the function will not modify the state of the object, it simply returns a result.
There is more which appears wrong with the code - but this might be a start.