Tuesday, July 28, 2009

If a man is paid C rupees an hour for 8 hours. after that he is paid double. how much is he paid for H hours?

Be careful, I don't think the first answer is accurate for all conditions.





I don't think the answer can be shown in a single formula because your line has a discontinuity at H=8. The slope of the line changes at that point.





If this were a computer program, you'd write it as:


IF H %26lt;= 8 then


Answer = C*H


ELSE


Answer = (C * H) + C * (H-8)


END IF





One of the flaws with the other answer's equation is that it doesn't consider that the person gets less for the first eight hours. The other flaw is that you have to consider the case where the person only works for four hours. You'll see that the way I'm handling the overtime condition is that the person always gets C rupees per hour (at least) + an additional C rupees for every hour over 8.





To write this as an equations, I forget the exact syntax, but it's along the lines of:


{For H%26lt;=8: C*H


For H%26gt;8: C*H + C*(H-8) }

If a man is paid C rupees an hour for 8 hours. after that he is paid double. how much is he paid for H hours?
At first he is payed 8C rupees.


Then he is payed 2C an hour. For H hours that would be (2C)H rupees.


No comments:

Post a Comment