It does run.
The only thing you need to do is add something to let you see the result, before the window closes: Try putting a breakpoint on the
return
statement, that would help for testing, or use
cin
to force another read from the keyboard before the application closes.
BTW: I would change the CalcPay function:
float CalcPay(float payrate, float hours)
{
float wages;
if (hours > max_hours)
wages = (max_hours * payrate) + (hours-max_hours) *payrate *overtime;
else
wages= hours * payrate;
return wages;
}
This way it returns the value, instead of modifying a parameter. That means you can use it in calculations:
float allPay = CalcPay(JoesRate, JoesHours) + CalcPay(MikesRate, MikesHours);