File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programming Diversions and the fly likes [Easy]Divide my uncle's estate!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "[Easy]Divide my uncle Watch "[Easy]Divide my uncle New topic
Author

[Easy]Divide my uncle's estate!!

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
This was asked recently by one company during test:
When my Uncle in Bombay died recently ,he left a will, instructing his executors to divide his estate of Rs. 1,920,000 in this manner:
Every son should receive three times as a daughter,and that every daughter should get twice as much as their mother
What is my aunt's share?


MH
Timothy Chen Allen
Ranch Hand

Joined: Mar 16, 2003
Posts: 161
Originally posted by Capablanca Kepler:

When my Uncle in Bombay died recently ,he left a will, instructing his executors to divide his estate of Rs. 1,920,000 in this manner:
Every son should receive three times as a daughter,and that every daughter should get twice as much as their mother
What is my aunt's share?

Assuming that A is the number of sons and B is the number of daughters, and "s" is the son's share, "d" the daughter's, and "m" the mother's, the formula for the mother's share would derive as follows:
s = 3d // Son's share is 3 x daughter's
d = 2m // Mom's share is 2 x mother's
As + Bd + m = 1920000
A(6m) + B(2m) + m = 1920000
m = 1920000 / (6A + 2B + 1)
Here is a Java program to show all possible combinations between 0 and 9 sons and/or daughters (assuming only one mother!):


Timothy Chen Allen
Learn Spanish in Washington, DC
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Easy]Divide my uncle's estate!!