In a startup software company, there are two kinds of employees, C Developers and Java Developers. Each employee has a unique ID as integer, a monthly salary as integer, and performance as integer, which can have an integer value between 1 to 5 (inclusive).
Furthermore, the startup company has three C Developers and three Java Developers as employees.
With this information given,
- Define a struct with three fields, and name:
- Name: Employee
- Fields: three integers ID, salary, and performance.
- Define another struct with two fields, and name:
- Name: Company
- Fields: two Employee arrays, one named cDevelopers, and the other one named javaDevelopers, both containing three elements.
- Write a function named maxPerformance which takes an array of Employees as input parameter
and finds the employee with the highest performance among the given employees and returns the ID of the employee as integer.
(Assume that the employee who has the highest performance for each employee type is unique).
Main program is given for you. In main program, information about employees are read from the user,
maxPerformance is called twice (once for C Developers and once for Java Developers), salary of the employees with the best performance
is increased by 500, and the ID and updated salary of the best performing employees are printed on the screen.
Don't change anything in main program.
Examples:
0 3000 4
1 3500 3
2 4000 2
0 2250 5
1 2500 3
2 2000 1
|
0 3500
0 2750
|
0 2000 3
1 3000 4
2 3000 1
0 2100 1
1 2400 3
2 2150 5
|
1 3500
2 2650
|
0 1400 1
1 2500 2
2 1500 3
0 3000 5
1 1500 3
2 2050 1
|
2 2000
0 3500
|
Important issues about all exams/projects/quizzes:
- Update just Question.c file, not Question.txt.
- Make changes only between the following comments(DO NOT modify these comments or anything outside the region marked by the comments):
- // DO_NOT_EDIT_ANYTHING_ABOVE_THIS_LINE
- // DO_NOT_EDIT_ANYTHING_BELOW_THIS_LINE
- If you modify these comments for any reason, you can copy/paste the initial version from Question.txt into Question.c. Note that Question.txt is not graded at all, so anything you write in Question.txt will be discarded.
- To avoid getting the 'Binary Not Found' error, SAVE and BUILD your code before RUN.
- Do not add any extra messages message for input/output such as 'Enter an integer:', 'The result is:', etc. Any additional text that appears in the output will cause you to get no points from the question.
- Input and output of your program must be just like those in the Examples table above.