|
|
Learning Outcome #3: Implement array structures to best organize and process the user’s data. You have been asked to finish the coding for a C++ program that grades the final exam for a college professor. The exam consists of 20 multiple choice questions (easy final exam!). The possible correct answers for each M/C question are A, B, C or D. Within this assignment file, you will find a file called, CorrectAnswers.txt, which contains the correct answers to the final exam. Go ahead and look at how the file is organized – each correct answer is printed on a separate line. You have also been supplied with a text file, StudentAnswers.txt, that contains the answers for a student who took the exam. You’ll see that the student answer file is formatted similar to the answer key (CorrectAnswers.txt). You have also been supplied with the code, HW_5.cpp, which is a partially coded C++ program to accomplish the following tasks: 1. Grade the student’s test by comparing the answer key (CorrectAnswers.txt) with the student’s responses (StudentAnswers.txt) 2. As your code “grades” the student’s answers, for each incorrect student response, display: 1) the question number that has been missed; 2) the student’s answer; and 3) the correct answer. o For example: Question 1 is incorrect Student answer: B Correct answer: A 3. summarize the student’s effort by displaying the total number of questions missed and the percentage of questions answered correctly. Formatting requirement: The percentage should be displayed in the format, for example, 81.0% - keep one digit after the decimal point. 4. if the student correctly answered 70% or more – print out a statement indicating that the student passed the final exam; otherwise, indicating the student failed the exam. Additionally, within the .cpp file, comment how/where you would change the code to process a class of 50 students (2 points). NOTES: o Place your name in the initial documentation of the .cpp file. This is a must in the requirement of good documentation style. o You may add to the program (additional screens, etc.) as long as the user (me!) knows how to interact with your program. o No input validation is needed – the files that have been supplied have already screened the input data. o I’ve supplied sample prototypes, calls and headers – if you want to create the needed functions using a different interface – that’s fine – as long as it’s efficient. o Remember to copy the answer key files into the same directory as your .cpp file before you compile and run your program. |