Question: //using putty //source code .c file #include typedef struct { char name[40]; int age; } student; #define SIZE 2 void getData(student[], int); void printData(student[], int);

 //using putty //source code .c file #include typedef struct { char

//using putty

//source code .c file

#include typedef struct { char name[40]; int age; } student; #define SIZE 2 void getData(student[], int); void printData(student[], int); int main() { student unixClass[SIZE]; getData(unixClass, SIZE); printData(unixClass, SIZE); return 0; } void getData(student anyAry[], int anySz) { int i, c; for (i = 0; i

void printData(student anyAry[], int anySz) { int i; for (i = 0; i 5 - x 6 E 1 reviewArrayFuncio.pdf x + V 0 file:///C:/Users/Jerem/Desktop/reviewArrayFuncio.pdf of 2 lo - + O Fit to page OD Page view A Read aloud L Add notes 6 H P 36 5. Run the program and understand it. Part II (30 pts) 1. Modify the program so that it will read student names from a data file and store them into unixClass array. Please use studentNames.txt as your input file. 2. Use rand function to generate a random age, ranging from 17 to 36 for each student in unixClass. 3. Change the constant SIZE to 500. This will be large enough to store all students from the input file. Remember 500 is defined as the original array size. It is not the actual student count. You will need to keep track the student count while getting input from the data file. 4. Save the file and run the program. Check the output carefully to be sure that you have processed all students from the input file with a proper generated age. Part III (30 pts) Add a function that will take the unixClass array and the student count as parameter. It will find out the count of each age and print the result. For example, your output from this function may as the following: Age Count Part IV (Bonus 20 points) 1. Add a function that will sort the entire array by age. Your comments must be very detailed in this function. You need to tell what sorting algorithm is used and how is this algorithm work. You can assume that I have never learn any sorting algorithms. Your comments will teach me so that I can follow your logic and understand your sorting algorithm. I reserve the right not award all 20 points if I feel the document is not clear. Deliverable: 1. There are 10 points reserved for program comments, indentations, meaningful variables and function names usage. 2. UNIX side: 5 - x 6 E 1 reviewArrayFuncio.pdf x + V 0 file:///C:/Users/Jerem/Desktop/reviewArrayFuncio.pdf of 2 lo - + O Fit to page OD Page view A Read aloud L Add notes 6 H P 36 5. Run the program and understand it. Part II (30 pts) 1. Modify the program so that it will read student names from a data file and store them into unixClass array. Please use studentNames.txt as your input file. 2. Use rand function to generate a random age, ranging from 17 to 36 for each student in unixClass. 3. Change the constant SIZE to 500. This will be large enough to store all students from the input file. Remember 500 is defined as the original array size. It is not the actual student count. You will need to keep track the student count while getting input from the data file. 4. Save the file and run the program. Check the output carefully to be sure that you have processed all students from the input file with a proper generated age. Part III (30 pts) Add a function that will take the unixClass array and the student count as parameter. It will find out the count of each age and print the result. For example, your output from this function may as the following: Age Count Part IV (Bonus 20 points) 1. Add a function that will sort the entire array by age. Your comments must be very detailed in this function. You need to tell what sorting algorithm is used and how is this algorithm work. You can assume that I have never learn any sorting algorithms. Your comments will teach me so that I can follow your logic and understand your sorting algorithm. I reserve the right not award all 20 points if I feel the document is not clear. Deliverable: 1. There are 10 points reserved for program comments, indentations, meaningful variables and function names usage. 2. UNIX side

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!