This shows what I am trying to describe:
Code:if (hours > STD_HOURS) { overtime = hours - STD_HOURS; overtime_pay = overtime * (wage + (wage / 2)); gross = wage * STD_HOURS + overtime_pay; } else { overtime = ? overtime_pay = ? gross = ? }
This shows what I am trying to describe:
Code:if (hours > STD_HOURS) { overtime = hours - STD_HOURS; overtime_pay = overtime * (wage + (wage / 2)); gross = wage * STD_HOURS + overtime_pay; } else { overtime = ? overtime_pay = ? gross = ? }
so in the else I am going to put the overtime and overtime_pay variable and initialize them to 0. Correct?
Try it and tell us if it solves the problem =)
Hey well whaddya know... it works. I think the way you put it is more elegant and more easier to read and that is the objective.
Hey Thanks much and if I can rep you or whatever on this forum, let me know.
Flowers would be nice.
Seriously, though, it was my pleasure to assist. For someone who is relatively new to programming (and these forums), you write good code, have a good consistent indentation style, and a seeming desire to learn. That's not as common around here as is should be, and it's nice when it happens.
Flowers sent ^^^^^^