I am new to C++ and have encountered a difficult (to me at least) homework problem.
The problem states: The payroll manager will enter the number of hours the employee worked and his or her pay rate. Employees working more than 40 hours should receive time and one-half for the hours over 40. Use a value-returning function to determine an employee’s gross pay. Use a different value-returning function to accumulate the total gross pay. The program should display the total gross pay only after the payroll manager has finished entering the data for all the employees. Use a sentinel value to end the program.
Here is what I have come up with so far. Any help on how to proceed would be appreciated. I am not looking for someone to just solve it for me, so explanations for modifications or additions/removals is highly valued.
A function for that is overkill, it's as simple as doing totalGrossPay += GROSS_PAY_FOR_CURRENT_EMPLOYEE inside the cycle, but if that's what the teacher wants you can just put the calculation in a function.
On line 29 you already have the function call to get the current employee's pay but the prototype says it wants two more parameters. You don't need to pass those, as they are calculated inside the function, so fix the prototype and the implementation signature. The implementation itself is also a bit wrong.
getTotalGrossPay() on the contrary needs one more parameter. You can't add to the total if you don't know how much to add.