Write a program to calculate the profit share of B given the investments and the number of Months of the partners A, B and C. The total profit is also given.
Input (Investment, Investment, Investment, double) |
Output (double) |
A = ["A", 500, 12], B = ["B", 800, 8], C = ["C", 600, 6] profit = 260.0 |
104.0 |
A = ["A", 10000, 12], B = ["B", 8000, 8], C = ["C", 4000, 10] profit = 2800.0 |
800.0 |
A = ["A", 50, 2], B = ["B", 90, 5], C = ["C", 10, 5] profit = 30.0 |
22.5 |
A = ["A", 5000, 20], B = ["B", 2000, 20], C = ["C", 9000, 15] profit = 3300.0 |
480.0 |