Question
please using c++ ( I need to cpp.file) visual studio 2015. please show me for code output and give to coments for coding and pseudo code for c++ thanks.
please how to show your output.
StudentAnswers.txt
A
D
B
C
B
A
C
B
D
C
A
D
B
A
C
A
D
B
C
A
A
D
B
C
A
A
D
B
D
C
A
D
B
A
C
C
D
B
C
A
A
A
B
C
B
A
C
B
D
D
B
D
B
B
C
C
D
B
C
A
A
B
B
A
B
A
D
C
D
D
A
B
B
A
A
B
D
B
C
A
B
D
B
C
A
A
D
B
D
C
A
D
B
A
C
C
D
C
C
B
A
C
B
B
B
A
A
B
D
D
B
D
B
A
B
C
D
A
B
A
C
D
B
C
A
A
D
B
D
C
A
D
B
A
C
D
D
B
C
A
A
C
B
C
A
A
D
B
D
C
A
D
B
A
C
C
D
B
C
A
A
B
C
C
D
B
D
B
D
D
A
D
B
A
C
D
C
B
C
A
B
D
B
C
A
A
C
B
D
C
A
D
B
A
C
C
A
B
C
A
A
D
C
C
B
A
D
B
D
D
A
D
B
A
B
C
D
B
C
A
CorrectAnswers.txt
A
D
B
C
A
A
D
B
D
C
A
D
B
A
C
C
D
B
C
A
10. Exam Grader One of your professors has asked you to write program to grade her final exa which consist of only 20 multi ple-choice questions. Each question has one of four pos A, B, C, or D. The file txt contains the correct answers all of the questions, with each answer written on a separate line. The first line contai the answer to the first question, the second li contains the answer to the second qu tion, and so forth. (Download the book's source code from the companion Web site www.pearsonhighered.com/gaddis. You will find the file in the Chapuca 07 folder. Write a program that reads the contents of the Correct Answers, txt e into a chi array, and then reads the contents of another file, containing a student's answers, in second char array. u can use the file StudentAnswers.txt for testing purpose is also in the Chapter 07 source code folder, available on the book's compani Web site.) The program should determine the number of questions that the stude missed, and then display the following: A list of the questions missed by the student, showing the correct answer and incorrect answer provided by the student for each missed question The total number of questions missed The percentage of questions answered correctly. This can be calculated as Correctly Answered Questions Total Number of Questions If the percentage of correct answered questions is 70% or greater, the p should indicate that the student passed the exam. Otherwise, it should that the student failed the exam, The correct Answers file contains exactly 20 answers that represent the correct answers for each question. That is, the first entry in the file is the correct answer for Problem l,the second entry is the correct answer for Problem 2, etc.) This file contains, in effect, the answer key for the exam, one answer per line. The studentAnswers file contains the answers the students actually entered on the exam, again, one answer per line. Each set of 20 lines in that file represents the answers for one student. We won't specify how many students are represented in the studentAnswers file (your program, therefore, needs to be able to detect this), but we will stipulate that there will not be any partial sets in that file. Your program should first read the answers in t into a character array. This array will serve as the answer key for the exam. Your program should then read the answers from the Student Answers file into another character array. You may safely use 300 as the size declarator for that array. Your program should then close both of the input files All subsequent processing will be done on the arrays only After all the input data have been read into the arrays, your program can begin to process the student answers array. (As we know, every set of 20 entries represents the answers for one student.) As your program examines the next answer, have it determine whether the answer was correct by comparing it against the proper entry in the answer key. Use accumulators to track the number of questions missed for each student so bullet points 2, 3, and 4 above can be answered correctly. Then print out your report for that student, reset the accumulators and counters, and proceed to the next student.
Explanation / Answer
B
C
A
A
B
C
C
D
B
D
B
D
D
A
D
B
A
C
D
C
B
C
A
B
D
B
C
A
A
C
B
D
C
A
D
B
A
C
C
A
B
C
A
A
D
C
C
B
A
D
B
D
D
A
D
B
A
B
C
D
B
C