I am just starting classes on c++ in college, and I'm having trouble with this "undefined reference to 'get_withholding_function'. I will put 3 stars on the line that is not working.
Then, on line 54, you are trying to call the function with two arguments: withHolding = get_withholding_function (dependents, grossPay); .
I see that you are calculating the netPay; however, you are only returning the value 0 back to the variable witHolding. regardless of the value of netPay. The reason I know this is because you have a return 0 (lin99).
On a final note, I see on line 69, you display the netPay; however, the variable netPay is not initialized (only declared). I hope this helps.
The variable overtimeDouble is not initiated. If you don't initialize it, then it would cause a run-time error.
The function double get_withholding_function (int dependents, double grossPay, double netPay) must have a return.
Two possible outcomes,
1. if you return withHolding , then it will send the withHolding value to line 57 and line 71.
2. if you return netPay, then it will send the netPay value to line 57 and line 71. Since the variable name is withHolding, you may not want to return netPay.
That being said, you must find a way to obtain netPay on line 72. If you don't, then the netPay will be zero. The zero is from the netPay initialization on line 31.
You are doing the calculations on netPay on the function double get_withholding_function (int dependents, double grossPay, double netPay), but it will not go anywhere, unless you return the netPay or pass the variable netPay by reference. There is another way to do it, but I will let you work it out.