File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programming Diversions and the fly likes Math question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Math question" Watch "Math question" New topic

Math question

Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
Say, Den is earning $100/month in January
It's Jan15 and he just know that got an offer which is $150/month.
However, if he chooses to leave now, he need to pay his old company back 1 month salary i.e. $100, and the compensation is pro rate.
i.e. if he leave on Jan16, he need to pay 100*29/30 back.
if he leave on Feb14 and start working in Feb15 in the new company, he doesn't need to pay the old company back.
So how to maximize his profit?
Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315

[ August 07, 2003: Message edited by: Jackie Wang ]
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1893
I am not getting,Why he shouldn't pay on Feb 14?bcos its on/before half of month?

Vivek Kumar

Joined: Sep 23, 2003
Posts: 9
Company A: current company (salary 100)
Company B: company with salary 150
If he is going to get his salary from 16 Jan to 14 Feb, in addition of not being forced to pay compensation, he should leave on Feb 14. Otherwise, he should leave immediately.
Dan Lastoria
Ranch Hand

Joined: Jan 30, 2002
Posts: 57
I'm sorry but I don't understand the original question. Can someone re-word it possibly?
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Let me give it a shot to reword it.
Dan gets one paycheck a month, on the 15th. But the paycheck is for last 30 days. But for the next 30 days.
So when he gets a paycheck on the 15th, that paycheck is for next 30 days, if he leaves, he has to pay it back. However, if he leaves on the 14th, which means he won't get a paycheck for the next 30 days, he doesn't pay anything back.
Is that correct?
I agree. Here's the link:
subject: Math question
It's not a secret anymore!