Write a program to grade an n -question multiplechoice exam (for n between 10 an
ID: 3614810 • Letter: W
Question
Write a program to grade an n-question multiplechoice exam (for n between 10 and 50) and provide feedback aboutthe most frequently missed questions. Your program will take datafrom the file examdat.txt. The first line of thefile contains the number of questions on the exam followed by aspace and then an n-character string of thecorrect answers. Write a function fgetAnswers thatinputs the answers from an open input file. Each of the lines thatfollow contain an integer student ID followed by a space and thenthat student's answers. Function fgetAnswers canalso be called to input a student's answers. Your program is toproduce an output file, report.txt, containing ananswer key, each student's ID and each student's score as apercentage, and then information about how many students missedeach question. Here are short sample input and outputfiles.examdat.txt
5 dbbac
111 dabac
102 dcbdc
251 dbbac
report.txt
ExamReport
Question 1 2 3 4 5
Answer d b b a c
ID Score(%)
111 80
102 60
251 100
Question 1 2 3 4 5
Missed by 0 2 0 1 0
Explanation / Answer
please rate - thanks #include #include void fgetAnswers(FILE*,int*,char[]); void fgetAnswers2(FILE*,int*,int,char[]); int main() {char ans[50],choices[50]; int n,i,id,missed[50],tot; FILE *input,*output; input = fopen("examdat.txt","r"); if(input == NULL) { printf("Error opening input file! "); getch(); return 0; } fgetAnswers(input,&n,ans); output = fopen("report.txt","w"); fprintf(output," Exam Report Question"); for(i=1;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.