Question: C Code - Structures, searching and sorting Skeleton Code: // prize.c #include #define MAX_SIZE 300 typedef struct { int id; // The student number int
C Code - Structures, searching and sorting

Skeleton Code:
// prize.c #include#define MAX_SIZE 300 typedef struct { int id; // The student number int scores[MAX_SIZE]; // The test scores of the student int prize; // Whether the student has received a prize } student_t; int main(void){ return 0; }
Test Data: http://www.comp.nus.edu.sg/~cs1010/practice/2017s1/Practice-S12P05/testdata/
Objective: Structure, Searching and Sorting Task statement There are n (1 n S 300) students in Mr Green's class, numbered 1 to n. For m (1 m S n) weeks, Mr Green sets a weekly test. For each test, he makes sure that their scores are all distinct, and he awards one prize to the top student in the test who has not been awarded any prize yet. Given the weekly scores of every student, for each week, find the student who received the prize Example: n-8, m-4, and the scores in the table below: Student Week 1 Week 2 Week 3 Week 4 79 57 53 80 64 48 53 69 59 75 59 68 2 3 4 81 58 46 76 48 42 85 70 65 64 73 67 61 6 69 70 52 So for week 1, student 6 received the prize, week 2 student 1, week 3 student 4 and week 4 student 7 Write a program prize.e which reads in the number of students and the number of weeks (both are integers in [1, 300]). It then reads in n rows of m integers whose values are in [0, 100]. Each row represents the scores a student obtained for the tests from week 1 to week m. This program then outputs a sequence of student numbers corresponding to the order in which the students received the prizes You should make use of the following structure type studentt in your program: typedef struct i int id; // The student number int scores [MAX SIZE]: // The test scores of the student int prize; // Whether the student has received a prize ) student t
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
