Question
The local driver's license office has asked you to create a Python application that grades the written portion of the driver's license exam. The exam
The local driver's license office has asked you to create a Python application that grades the written portion of the driver's license exam. The exam has 20 multiple choice questions. Here are the answers 1. B , 2. D, 3. A, 4. A, 5. C, 6. A, 7. B, 8. A, 9.C, 10.D, 11.B, 12.C, 13.D, 14.A, 15.D, 16.C, 17.C, 18.B, 19.D, 20.A Your program should store these correct answers in a list. The program should read the student's answer for each of the 20 questions from a text file and store the answers in another list. After the student's answers have been read from the file, the program should display a message indicating whether the student passed or failed the exam. (Must answer 15 correctly to pass). It should then display the total number of correct answered questions, the number of incorrect, and a list showing the question numbers of the incorrect answers.
The correct answers for the test will be stored in your program as a list, such as the one below. In fact, you may use the code below in your program:
correct_answers = ['A', 'C', 'A', 'A', 'D', 'B', 'C', 'A', 'C', 'B', 'A', 'D', 'C', 'A', 'D', 'C', 'B', 'B', 'D', 'A']
The test taker's answers will be stored in a file called "student_answers.txt" - a sample is below. Your program will read the answers from the "answers.txt" file and store them in a list, and then compare them with the answers in the "correct_answers" list, and perform the analysis required by the specifications (tell the examinee if they passed or failed (15 of 20 questions is required to pass); how many questions they answered correctly, how many incorrect, and a list of the question numbers of incorrectly answered questions.
Other: Compute the score for the test (number correct divided by number of questions) show with percent sign.
Include your name in comments in the code, and also as the name of the examinee in the output.
Example output:
Name of Examinee: your name (e.g., "Angela Cruz")
Score: 80.0%
Congratulation, you passed the exam! (or "Sorry, you did not pass the exam this time")
Number correct: 16
Number incorrect: 4
Questions missed: 2, 6, 7, 15
sample test file: student_answers.txt: A D A A D D D A C B A D C A C C B B D A
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started