I need help with the following code… Instructions: This lab builds on the skills from Lab…

I need help with the following code…
Instructions:
This lab builds on the skills from Lab
2c, in which you read data values from a file and kept a count of
the number of invalid values. In this lab, your program will be
using the same code to read each data entry from the file, but you
will also save each value in an array named allMags after
each is read in. When all values in the file have been read, your
program should call various functions to perform processing tasks
using the array values.
You will be working in teams of 3,
with duties assigned as follows:
Part a.   
Together, write and test the function to create a new array of just
valid magnitude values
All Team
Members:   First add the code needed in your
overall large program to read ALL of the values in the data file
and save them, one by one, in an array named allMags.
Together, write a getValids function, which takes an array
of floating point values, and copies only the valid values into a
new array also provided as an input parameter. Name your program
lastname1_lastname2_lastname3.c, including all of the last names of
the team members.
Add this new function
getValids below the main function in your
program. Don’t forget to add a prototype statement for the
function, above main. Question 1: where should the new
array containing only valid values be defined? (Hint: Name the new
array validMags, but do not create it inside the
getValids function.) Question 2: Does each function that
processes an array provided as a parameter need to have the length
of the array provided as a parameter as well?
Add the code to call the
getValids function from main, and test your program to
make sure that it works correctly by displaying all of the values
in the validMags array after the getValids
function returns.
In the next part, the code for the
each of the tasks should be completed separately by each team
member, tested, and if correct, added to the overall program. Don’t
forget to add the functions below main and to define
prototypes for each.
THIS IS THE CODE FROM LAB2C:
#include
int main(void) {
FILE* inFile = NULL; // File pointer
float fileNum; // Data value from file
int value_greater_than_three =0 , invalid_entries = 0 ,i =0;
// Open file
printf(“Opening file epquakes.txt n”);
inFile = fopen(“epquakes.txt”, “r”);
if (inFile == NULL) {
printf(“Could not open file epquakes.txt n”);
return -1; // -1 indicates error
}
// Print read numbers to output
printf(“Reading and printing numbers.n”);
/* while (!feof(inFile)) {
fscanf(inFile, “%f”, &fileNum);
printf(“num: %fn”, fileNum);
if(fileNum > 3.0)
value_greater_than_three++;
if(fileNum < 0.0) invalid_entries++; } */ for(i=0;i 3.0) value_greater_than_three++; if(fileNum < 0.0) invalid_entries++; } printf("Closing file epquakes.txt n"); // Done with file, so close it fclose(inFile); printf("%d entries are greater than 3 n",value_greater_than_three); printf("%d entries are invalid entries n",invalid_entries); return 0; } THANKS!