Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A certain company offers several annual salary levels (dollars): 12,000, 15,000,

ID: 3530700 • Letter: A

Question

A certain company offers several annual salary levels (dollars): 12,000, 15,000, 18,000, 24,000, 35,000, 50,000, and 70,000. The number of employees paid at each level are, respectively: 3000, 2500, 1500, 1000, 400, 100, 25. Write some statements at the command line to find the following: a. The average salary level. Use mean. (ans. 32,000) b. The number of employees above and below this average salary level. Use logical vectors to find which salary levels are above and below the average level. Multiply these logical vectors element by element with the employee vector, and sum the result (ans. 525 above, 8000 below) c. The average salary earned by an individual in the company (i.e., the total annual salary bill divided by the total number of employees) (ans. 17,038.12)

Explanation / Answer

%THis looks like a simple problem. Do you want it to print with fprintf or just as ans? If so, uncomment lines

levels=[12000, 15000, 18000, 24000, 35000, 50000, 70000];

employees=[3000, 2500, 1500, 1000, 400, 100, 25];


avg=mean(levels)

%fprintf('The average salary level is %d. ',avg);


below=sum(employees(levels<avg))

above=sum(employees(levels>avg))

%fprintf('There are %d employees above and %d employees below the average %salary level.',below,above);


IndividualAvg=(employees*levels')/sum(employees)

fprintf('The individual in the company averages to about %.2f',IndividualAvg);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote