Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 pleaseimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

8. Explain how to price managerial and professional jobs.

Answered: 1 week ago