I need help! I keep getting this error in line 46
initialization with {..} expected for agrregate object
and error c2440 cannot convert from bool to double []
Ok so i somehow fixed the error but i cant get the code to output correctly.. Let me explain what im doing first. I need to compare the student answers to the answer key and see how many of them they got right. For each question they got right, they get five points. The hard part is how do i compare the answerkey to the students answers. The answer key is in the first line of the file and the next line followed by the students ID and their answers for the 20 questions. After that i have to output the results to a output file which i know how to do and their scores.
you have to open the file which contains the answer key
then create an array where index [0] represents question 1, index[1] represents question 2, etc..
im assuming your text file is in this format:
50
20
40
30
?? where 50 is the right answer for question 1, 20 for question 2 and so on?
If it is like this, then you just have to read in the first value, put it in the first index, read in the second value, put it in the second index...
when you're done, make another for loop which iterates through student[] and answer[] and compare each index to see if they match
student[0] == answer[0]
they got it right!!
else
wrong