Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

#include typedef struct { char name[40]; int age; } student; #define SIZE 500 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 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

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

The instruction MOV CX , SI is what addressing mode?

Answered: 1 week ago

Question

Develop successful mentoring programs. page 400

Answered: 1 week ago