Question: WRITE C PROGRAM. Check your program carefully before submission. Test data differs from the sample input will be used in the grading. Make sure your

WRITE C PROGRAM.WRITE C PROGRAM. Check your program carefully before submission. Test data differs

Check your program carefully before submission. Test data differs from the sample input will be used in the grading. Make sure your program works properly for all possible cases. File in.txt stores the information for multiple students including ID, name and score of math and physics. The first line of in .txt indicates the number of students. Your program need to read the content of in.txt, calculate the sum of students' score and write students' ID, name and total score to the file out. txt. The students in out.txt should be in the order defined as follows. You need to use qsort function in header file stdlib.h to sort the students. Do not write your own code for sorting. (a) The student with greater total grade will rank first. (b) If two students have the same total grade, the student with less student ID will rank first. Students' IDs will always be unique. Dynamic structure array allocation and deallocation is required. Sample Input &; Output The content of in.txt is 4 105 Tom 76 74 103 Jim 67 88 101 Lucy 72 78 185 Sam 57 67 The content of out.txt is 103 Jim 155 101 Lucy 150 105 Tom 150 185 Sam 124

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!