The local Driver’s License Office has asked you to write a program that grades t
ID: 3676694 • Letter: T
Question
The local Driver’s License Office has asked you to write a program that grades the written portion of the driver’s license exam. The exam has 20 multiple choice questions.
Here are the correct answers:
1. B 6. A 11. B 16.C
2. D 7. A 12. D 17.A
3. A 8. D 13. C 18.D
4. A 9. B 14. A 19.A
5. C 10. B 15. C 20.A
The program should have a class name of Exam. Your program should store the correct answers shown above in an array.
The program should include a looping mechanism to prompt the user to enter each of the 20 student answers. It should ask the user to enter the student’s answers for each of the 20 questions, which should be stored into a second array.
The program should contain a static public method Correct, which accepts the two arrays as arguments and returns the number of correct answers.
The program should display the total number of correctly answered questions, along with a message indicating whether the student passed or failed the exam. (A student must correctly answer 15 of the 20 questions to pass the exam).
The program should accept only valid responses for each question: A, B, C or D.
Explanation / Answer
Hi below i have written the code for your reference.
#include <iostream>Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.