Question
THIS IS A MATLAB PROGRAM QUESTION!! The top management of a company is made up of the following staff groupings: Executives, Directors, Engineers and Technicians.
THIS IS A MATLAB PROGRAM QUESTION!!
The top management of a company is made up of the following staff groupings: Executives, Directors, Engineers and Technicians. The following are the salary categories of the staff:
Executives are staff who make at least $130,000, Directors make at least $ 100,000 but not up to $130,000, Engineers make at least $75,000 but not up to $100,000, and Technician make less than $75,000
Write a function called mystaff that takes one input matrix called S. S is an n-by-m matrix whose elements are the salaries of all staff of the company. Your function does not return any value. Your function should check for a non-scalar input. Import the excel data to start this problem from the eLC in the project 2 folder. Use your function to do the following:
S=
72000 | 120050 | 78552 | 75822 | 82800 | 114048 | 79552 | 90228 | 152002 | 100000 |
45852 | 25454 | 102444 | 69877 | 52730 | 24181 | 103444 | 83154 | 78566 | 77600 |
45785 | 34897 | 58200 | 45811 | 52653 | 42298 | 59200 | 54515 | 45200 | 66200 |
87254 | 45877 | 78600 | 125444 | 100342 | 43583 | 79600 | 149278 | 87500 | 55200 |
124875 | 69778 | 56200 | 58700 | 143606 | 66289 | 57200 | 69853 | 98200 | 65433 |
135444 | 120000 | 36400 | 96400 | 155761 | 114000 | 37400 | 114716 | 87566 | 45899 |
89254 | 56444 | 42560 | 78000 | 102642 | 53622 | 43560 | 92820 | 45800 | 78266 |
54789 | 54866 | 48652 | 56400 | 63007 | 52123 | 49652 | 67116 | 68700 | 45833 |
69784 | 65028 | 49587 | 87500 | 80252 | 61777 | 50587 | 104125 | 46800 | 59122 |
78525 | 89125 | 51258 | 45800 | 90304 | 84669 | 52258 | 54502 | 98200 | 65388 |
a.
i. Determine the average salary of all Executives in the company
ii. Determine the average salary of all Directors in the company
iii. Determine the average salary of all Engineers in the company
iv. Determine the average salary of all Technicians in the company
For part a, use fprintf statements so that your output will look like this when you run the code:
The Average salary of n1 Executives in the company is:$XXX.yy
The Average salary of n2 Directors in the company is:$XXX.yy
The Average salary of n3 Engineers in the company is:$XXX.yy
The Average salary of n4 Engineers in the company is:$XXX.yy
[Note: n1, n2, n3 and n4 represent number of executives, directors, engineers and technicians respectively in the company. XXX.yy are average salaries.]
b.
Starting July 1, 2017, the company will adjust salaries as follows: Executives will get an adjustment of 12%, Directors will get 10%, Engineers will get 8% and technicians will get 5%. Use this to determine:
i. The total yearly salary of all executives in the company for 2017
ii. The total yearly salary of all directors in the company for 2017
iii. The total yearly salary of all the Engineers in the company for 2017
iv. The total yearly salary of all technicians in the company for 2017
v. The total yearly salary expenditure of the company at the end of the year 2017.
Your output for part b should look exactly like this where YY.yy are total 2017 salaries:
2017 Salary Summary
Executives : $YY.yy
Directors : $YY.yy
Engineers : $YY.yy
Technicians : $YY.yy
TOTAL : $$YY.yy
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started