Question: Code in C please Requirements: In this lab, four functions need to be implemented using the following function prototypes: 1. float* read FloatSalaryIntoArray(FILE* fp, int*

Code in C pleaseCode in C please Requirements: In this lab, four functions need to

Requirements: In this lab, four functions need to be implemented using the following function prototypes: 1. float* read FloatSalaryIntoArray(FILE* fp, int* totalNumOfEmployee, float* average Salary) This function reads a file pointed by a file pointer (fp), and populates a float array with its data. The first line in this file indicates how many employees there are in a company, each of the rest lines indicates the salary of an employee. This function also computes the average salary of all employees. The number of total employees and the average salary is passed back by reference. The populated float array is returned as the output of this function. 2. void find Min Max(float* arr, int size, float* minSal, float* maxsal) This function searches the minimum salary and maximum salary in this given array, and passes the values back by reference. 3. void freeArray(float** arrptr) This function frees the allocated memory and sets the array pointer back to NULL. 4. A calling function (main function) also needs to be completed, which opens the given text file, populates a float array using the first function, computes and prints the min, max, average salaries, and frees all the allocated memories. Example output: There're in total 2000 employees, the average salary is 46001.18 Largest salary is 79998.52, smallest salary is 10130.21 Grading Criteria: readFloatSalaryIntoArray function: 6 points find Min Max function: 3 points freeArray function: 3 points main function: 3 points

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!