the program works, but i\'m not sure how to get the grosspay to add the overtime pay once the if condition is set, I was told to set overtime pay to zero on the declaration. Is
You need to calculate the overtime pay first, before outputting the gross pay:
if(hw > 40) OvertimePay = (hw - 40) * hp * 0.5; gp = hw * hp + OvertimePay;