Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the necessary Python code to meet the following user requirements. Background: The local driver s license office has asked you to create an application
Create the necessary Python code to meet the following user requirements.
Background: The local drivers license office has asked you to create an application that
automatically grades the written portion of the drivers license exam. The written exam is a
question multiple choice test and a minimum passing score is out of
The application should be a Python console application
The application should store the correct answers in a list
Student responses will be provided in a text file. Each line of the file consists of a student name
and their responses to the written exam.
The application should grade each student and provide the following as a summary for each
student...
o The number of correct responses
o The number of incorrect responses
o A list of the question numbers answered incorrectly
o A message indicating whether the student passed or failed.
The correct answers are:
A
C
A
A
D
B
C
A
C
B
A
D
C
A
D
C
B
B
D
A
The external file of student scores is provided with the assignment StudentResponsestxt Be sure
to copy this text file into your DriversLicenseExam project folder. The data contained in the file is:
MARK,AAAABBCACAADCABCBBBD
MIKE,ACAADBCACBADCADBBBCA
JOHN,ACBBCBCACBBCCBCCBBDA
MARY,ACAADBCACBADCADCBBDA
ELLEN,BBBACBCABBADCADCCCDA
MARK,AAAABBCACAADCABCBBBD
The following are general steps that you can follow for creating this project.
o Create a list or tuple to store the correct responses
o Initialize an empty dictionary that will store student responses sResponsesDictionary
and initialize another empty dictionary that will store student grade results
sGradesDictionary
o Read in the data from the StudentResponse.txt file.
o For each record in the StudentResponse.txt file, add an entry to the
sResponsesDictionary dictionary. The key for the new entry will be the student name.
The value corresponding to this key will be a list of the student responses.
o For each record in the StudentResponse.txt file, determine the total number of correct
responses, the total number of incorrect responses, a list of incorrect responses, and
PASS or FAIL indicator.
o For each record in the StudentResponse.txt file, add an entry to the sGradesDictionary
dictionary. The key for the new entry will be the student name. The value
corresponding to this key will be a set of values; the total number of correct responses,
the total number of incorrect responses, a list of incorrect responses, and PASS or
FAIL indicator.
o After the two dictionaries have been created in full ie both dictionaries contain data
for all students print out the contents of both dictionaries.
o Loop through the sGradesDctionary and print out a summary for each student. The
summary should display the student name, the number of correct responses, the
number of incorrect responses, a list of incorrect responses, and a message indicating
Pass or Fail.
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