How would you do it? Would you divide by 40 and take the remainder? That's what mod does. If you don't understand what the program is supposed to do, there is no way you can actually write the program. That's why I told you in my other post that you need to work it out on paper. Calculate it for a lot of different values (it's really easy). How many hours of overtime did they work if they worked:
47 hours that week?
53?
75?
88?
100?
Reply to me in this thread with the answer for those 5 numbers above, and tell me what operation you used to figure that out.
EDIT: Just saw your post...disregard this if it works