This is not homework because I am not a student. This is for my general curiosity. I apologize if I invent the wheel here. The function I'm looking for can be defined as follows (language agnostic):
int getPercentageOfA(double moneyA, double workA, double moneyB, double workB)
{
return result;
}
Suppose Alice and Bob want to work together ... for example ... sell used books. Alice is only interested in investing money in her and nothing more. Bob could invest some money, but he would not have the funds available for investment. However, he will make every effort to find a seller, buyer and service.
There are no tools, education, health insurance costs or other expenses. Both Alice and Bob want to share the profit “equally” (different weight, for example, 40/60 for advanced users). Both are entrepreneurs, so they deal with low profitability / wages and high incomes. There is no fixed wage, minimum wage, fixed ROI or minimum ROI. They are trying to find the best deal possible, take the risks and take it.
Now let's stick to the 50/50 model. If Alice invests $ 100, Bob invests in work, and they make a profit (or loss) of $ 60, they will share it equally - both will receive $ 30 for their efforts / investments, or Bob will end up for $ 30 with Alice.
: , 100, , 60 . , 15 , 30 , , 30 50/50.
, A B 35/65 . : , $70, $30 + . : (70,30) = (30,30) + (40,0)... , . ( ) : , 70 30 , ?
:
- A B $50/50.
- A 100% , B 100% - 50/50.
- A - 100 A/0 B ( ).
- A 50% , B 50% , - 25 A 75 B ( ).
, workA = 0%, workB = 100% , getPercentageOfA : height z x y. , ? ?
, workA 0% , 85/15 - , ?