hello everyone. i have been attempting to make an if statement that calculates overtime hours for quite some time now and i cant seem to get it to work correctly. Is it possible to make this statement with 1 line? or am i missing somthing? this is what i thought would work, but apparently it doesnt... :(
if (hours<=40)
pay = rate * hours;
if (hours>40)
pay= (hours - 40 * 1.5 * rate) + (rate*hours)