Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The deadline of submission is March 27th. Acceptable file format for submission is C source file, not a text file, archive file, word document or

image text in transcribed

The deadline of submission is March 27th. Acceptable file format for submission is C source file, not a text file, archive file, word document or executable file. You just need to submit the C source file. Do not submit the input file or the output file. 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

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

More Books

Students also viewed these Databases questions