subject
Mathematics, 12.03.2021 20:30 christiannpettyy

John wants to give a total bonus of $851 to his three employees taking fairly as possible into account their number of days of absence during the period under consideration. Employee A was absent 18 days, B 15 days, and C 12 days. The more absences, the lower the bonus ...

How much should each employee receive? John thinks A should receive $230, B $276, C $345 since 230 * 18 = 276 * 15 = 345 * 12 and 230 + 276 + 345 = 851.

Task:
Given an array arr (numbers of days of absence for each employee) and a number s (total bonus) the function bonus(arr, s) will follow John's way and return an array of the fair bonuses of all employees in the same order as their numbers of days of absences.

s and all elements of arr are positive integers.

Examples:
bonus([18, 15, 12], 851) -> [230, 276, 345]

bonus([30, 27, 8, 14, 7], 34067) -> [2772, 3080, 10395, 5940, 11880]
Notes

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 21.06.2019 12:30
For the following sequence determine the common difference (if it is an arithmetic sequence) or the common ratio (if it is a geometric sequence).
Answers: 3
question
Mathematics, 21.06.2019 20:00
Mat bought a phone for $100. he has to pay $30 per mouth. if he has paid $640 in total, how many mouth has he had the phone?
Answers: 2
question
Mathematics, 21.06.2019 21:00
X+y=-4 x-y=2 use elimination with adding and subtraction
Answers: 3
question
Mathematics, 21.06.2019 22:00
To decrease an amount by 16% what single multiplier would you use
Answers: 1
You know the right answer?
John wants to give a total bonus of $851 to his three employees taking fairly as possible into accou...
Questions
question
Mathematics, 28.09.2019 15:10
question
Mathematics, 28.09.2019 15:10
Questions on the website: 13722359