3 Attachment(s)
C program for reading text files and calculating and store in another file
how to program this one
Usage of Arrays, Functions and Files
Students are expected to write, compile, run and test a complete C program to evaluate multiple-choice examination results of the students. For that purpose, three text files are provided involving student’s information, answers, and the solution key. Solution key ‘booklet.txt’ contains three rows containing correct answers for three different booklet types, namely, A, B, and C. Student’s answers are given in ‘answers.txt’. Student’s departmental information is given in ‘students.txt’. The program shall read all three files and produce a new file called ‘results.txt’ containing the results in the given format.
‘booklet.txt’ content looks like below (each booklet type has 50 correct answers)
ACBAA*DBC*DDAACDBACCABDCABCCBDDABC*CABABABCBD*AABD
…
‘answers.txt’ content looks like below (* means unanswered)
117429 A DBA*DCACBACDBABDCABBCADACCBBDDAABC*CABABCDBDC*AABD
124259 B D*DBCBAAC*CBACBBDA*BDA*CCABAACDBABBCAADD*CBD*AABCA
…
‘students.txt’ content looks like below (ID, name-surname, and department)
117429 MEHMET AKYOL SENG
124259 EMRE YASAR EEE
…
Write a C program that makes use the following functions to be defined:
a) read keys for three booklet types into corresponding array
b) read one student information into corresponding arrays
c) read one student answers into corresponding array
d) evaluation of one student answers
e) statistics on student’s answers
‘results.txt’ file content may look like as below (4 wrong answer cancels a correct answer!)
PART-A (Results)
Std. No. Name & Surname Department Correct Wrong Score
117429 MEHMET AKYOL SENG 28 20 46.0
…
PART-B (Statistics)
Booklet-A
Question Correct choice A B C D Blank Success
1 D 3 2 4 5 1 %33.3
2 B 5 9 1 7 2 %37.5
…
Booklet-B
…
Booklet-C
…
how to do this one