Project Title : Student Grading System
Purpose : Calculate the grade and sort the student matrix in descending
example Input file : studentsmark.txt
example Output file: studentresult.txt
How the user operate the software:
1) user run the software
2) an interface show on the screen
3) user keyin Input file name (example:studentsmarks.txt)
4) user keyin Output file name (example:studentresult.txt)
5) user select function to calculate and sort
6) Then an output file stored student result generated
7) user can select option to continue another input file or quit the software
Formular:
1) please exam studentsmark.txt and studentresult.txt
2) the result listing in the studentresult.txt must be sort by student matrix
3) Grade : MARKS >= 80 Then A
MARKS >= 75 Then A-
MARKS >= 70 Then B+
MARKS >= 65 Then B
MARKS >= 60 Then B-
MARKS >= 55 Then C+
MARKS >= 50 Then C
MARKS >= 45 Then C-
MARKS >= 40 Then D+
MARKS >= 35 Then D
MARKS < 35 Then E
input file : studentsmark.txt
01234012345678901234567890123456789
0123401234567890123456789012345678901234567890123456789012345678901234567890123456789
No Matrix quiz1(5%) quiz1(5%) quiz1(5%) Proj(25%) MidT(20%)
1 BK20008 4 3 5 18 18
2 BK20002 5 5 4 10 8
3 BK20003 3 4 5 18 10
4 BK20006 4 3 4 20 14
5 BK20005 5 4 3 13 17
6 BK20004 2 5 2 4 16
7 BK20007 3 4 4 21 14
8 BK20001 4 3 5 11 15
9 BK20009 3 2 4 10 10
10 BK20010 4 3 3 23 18
i have written the first part that is to read the file content
but obviously it cannot run
#include <stdio.h>
void main (void)
{
char matrix[200];
int i, j, num_elem, no[20], quiz_1[20], quiz_2[20], quiz_3[20], project[20], midT[20];
FILE *infile;
infile = fopen("studentsmark.txt","r");
i=1;
while( fscanf(infile,"%d %s %d %d %d %d %d %d",&no[i],&matrix[i], &quiz_1[i], &quiz_2[i], &quiz_3[i], &project[i], &midT[i]) !=EOF) i++;
num_elem = i;
for(j=1;j<num_elem;j++)
{
printf("%d %s %d %d %d %d %d %d\n",no[j], matrix[i], quiz_1[j], quiz_2[j], quiz_3[j], project[j], midT[j]);
}
fclose(infile);
}
it only can run if i remove the 1st line and matrix coloum, please tell me what to do..i'm real weak in programming..