Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to divide the total inheritance ($1587654) into the parents, children and relatives according to the instruction below. What are the inheritance for the administrator, parents, children and relatives?

Instruction:

1. Firstly, the administrator gets a quarter of one percent of the inheritance plus whatever is left over (nobody receives fractions of dollars, just whole dollars).
2. Each non-child, non-parent relative gets one portion
3. Each child get 100 times the amount of each relative
4. Each parent get twice as much as each child

Code:

import random

total_inheritance = 1587654
administrator_percent = 0.025
parents = 2
children = 3
relatives = 10
Posted
Comments
PIEBALDconsult 26-Jul-14 1:51am    
Sounds like homework. We don't do that here.

And it doesn't include how many of each type.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900