Given Structs:

typedef struct quiz {

int quizID;

int quizQuest;

} quiz;

typedef struct student {

int numQuiz;

quiz* quizIndex;

int sumQuest;

} student;

Based on these structs I need to use this function prototype to read in details from a file dynamically allocating space for a single student, create an array, updates quizQuest int from the struct(along with other variables), and returns a pointer to struct (dynamic allocation)

The prototype doesn’t take in any parameters:

student* enterStudent();

Here is the format of the input file:

3 //This part of the file is for a different function but is used still

Math //0 quizID

English //1 quizID

Spanish //2 quizID

2 //Section that needs to be read, the 2 here represents the number of students

3 0 2 1 3 2 1 //3 is numQuiz, 0 quizID (Math), 2 is quizQuest, and so on

2 0 4 1 2 //2 is numQuiz, 0 quizID, 4 is quizQuest, 1 is quizID , and 2 is quizQuest


sumQuest should equal the total quizQuest’s for each student

quizIndex should be used as an array : quizIndex[i].quizID or quizIndex[i].quizQuest for example.

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!