Question
1) Modify the program so that it can read student names from a data file named studentNames.txt and store them into the unixClass array. 2)
1) Modify the program so that it can read student names from a data file named studentNames.txt and store them into the unixClass array.
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.
5) 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
6) 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.
#include void printData(student anyAry[], int anySz) { int i; for (i = 0; i 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started