N
NightWarrior
Guest
Nic,
I gave you the code because it was exactly what was needed. ComputeHourlyPay should only look like this:
double ComputeHourlyPay(double hoursWorked, double hourlyRate)
{
return hoursWorked * hourlyRate;
}
You can't have ComputeHourlyPay figuring out OT pay and regular pay, how would you ever get those values back? You will have to call this function twice as it is above, once for the hours 40 and under and then once for the hours 41+. I made it simple, gave you the code already. What you have makes it impossible to display regular pay and ot pay because ComputeHourlyPay as you have it will only return total pay. Think about it....
I gave you the code because it was exactly what was needed. ComputeHourlyPay should only look like this:
double ComputeHourlyPay(double hoursWorked, double hourlyRate)
{
return hoursWorked * hourlyRate;
}
You can't have ComputeHourlyPay figuring out OT pay and regular pay, how would you ever get those values back? You will have to call this function twice as it is above, once for the hours 40 and under and then once for the hours 41+. I made it simple, gave you the code already. What you have makes it impossible to display regular pay and ot pay because ComputeHourlyPay as you have it will only return total pay. Think about it....