Im preparing for an exam and Im wondering if anyone can show me an example code for this project:
Stores information on salaries of employees of an enterprise in a two
dimentional array. The company has several departments and each department has
several employees. Define two constants to specify "number of departments" and
"MaxNumEmployees" containing a number of departments in the company and the
maximum number of employees in the department. Store information about salaries of employees in the array. If the number of employees in one department does not reach the maximum limit, -1 is entered after the last employee.
Write a function that receives an array as in a) and the size of the array. The
function creates a dynamic array containing the average salary of employees in each department, and returns a pointer which points at the array.
int main()
{
int size1 = number_of_departments;
int size2 = max_number_of_employees;
int A[size1][size2] =...
Your code is not valid C++ code and does not corresponds to the assignment where there is said:
Define two constants to specify "number of departments" and "MaxNumEmployees" containing a number of departments in the company and the maximum number of employees in the department
So it should be written as
1 2 3 4 5
int main()
{
constint number_of_departments = 5; /* can be any value */
constint max_number_of_employees = 10; /* can be any value */
float salaries[number_of_departments][max_number_of_employees] = ...