Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In C Programming: 3. (4pt) Suppose a data file (say student.txt) contains studen

ID: 665555 • Letter: I

Question

In C Programming:

3. (4pt) Suppose a data file (say student.txt) contains student ID followed by nine numbers denoting the grades she/he got for each hw. As we will do in this class, we want to drop the lowest hw grade and compute the average for each student based on the best eight hw grades. For example, here is a sample file containing three students and their 9 hw grades: Write a program that can read the above file and output the student ID, and the average score based on the best eight hw grades into output.txt file. For the above file, your program should generate the following output.txt file:

Explanation / Answer

#include int main(){ char name[3]; int marks,i,n; printf("Enter number of students: "); scanf("%d",&n); int ar[100],n,i,small=0; 07        08      printf("Enter the size of the array "); 09      scanf("%d",&n); 10        11      printf("Enter the elements of the array "); 12      for(i=0;i