Newbie here. Here's a description: A class of students take a 20-question MC exam and each question has five choices (A,B,C,D,E), only one correct and assuming every student answers all questions. The Tests.dat file consist of StudentID and their responses to the exam. Answers.dat is the answer key.
PART 1) I need to write a program that reads in the correct answers from Answers.dat and then loop through the Tests.dat to produce a report that displays the studentid and number correct as follows:
Student ID Number Correct
430-52-6192 13
112-81-5225 19
etc etc.
PART 2) Also, it needs to display number of students taking exam.
PART 3) I need to display a 2D array (counter[20][5]) to show the total number of students who chose each choice by question and print asterisks next to the correct answer as follows:
Question A B C D E
1 5 1 13* 3 1
2 4 7* 1 7 4
....etc
20 2 0 1 1 19*
Part 3 is the trouble I am having trouble with. I tried google and this forum but can't seem to find an answer. I posted my code and any help is appreciative.
Thanks. That fixes my formatting where it outputs 20 rows and 5 columns like I need it to. However, I don't know what code to put in the section where I made a comment //PRETTY SURE SOMETHING GOES HERE BUT NOT SURE. I put counter[i][j]++; in that spot and got the output below. See PART3 above for a description of what I need. Here is my incorrect output:
Question A B C D E
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
2323232323
I need it to be this:
Question A B C D E
1 5 1 13* 3 1
2 4 7* 1 7 4
(etc etc)
20 2 0 1 1 19*
Another note about the above reply. As you see, the output is adding the numbers instead of separating them like it's suppose to. any help would be excellent.