Re: help me to solve this math maze
| From: | Zoltán Németh | Date: | Wed, 04 Apr 2007 09:54:33 +0000 |
| Subject: | Re: help me to solve this math maze | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252022@lists.php.net to get a copy of this message | ||
2007. 04. 4, szerda keltezéssel 12.44-kor Faisal Murad ezt írta:
> i am making a program to give money to a group of people
> lets say that i have to distribute 3000 among 12
> people 6 of them are adult and will get 100%
> 6 them are children those will get 75% from the overall amount.
>
> a common solution might appear as
>
> divide 3000 to 12 which is 250
> give 250 to adults and 75% percent of it to children which is 187.5
> after this kind of calculation i have 375 more to give which was supposed to be
> equally distributed among them
>
> can anyone understand my problem and assists me.
$adultmoney = $totalmoney / ($adultnumber + 0.75 * $childnumber);
$childmoney = 0.75 * $adultmoney;
greets
Zoltán Németh
>
> faisal