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 17:00
Asocial networking site currently has 400,000 active members, and that figure is predicted to increase by 32% each year. the following expression represents the number of active members on the site after t years.
Answers: 1
question
Mathematics, 21.06.2019 19:50
Which inequality is equivalent to -3x < -12? x < 4 , x < -4 , x > 4, x > -4
Answers: 1
question
Mathematics, 22.06.2019 01:30
How do you write 0.5% as a fraction
Answers: 1
question
Mathematics, 22.06.2019 03:00
The first triangle is dilated to form the second triangle. select true or false for each statement. statement true false the scale factor is 0.625. the scale factor is 1.6. a right triangle with a side length of .5. an arrow points to a larger right triangle with a side length of .8
Answers: 3
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, 02.03.2021 07:40
question
Spanish, 02.03.2021 07:40
question
Mathematics, 02.03.2021 07:40
question
Mathematics, 02.03.2021 07:40
Questions on the website: 13722361