Answered step by step
Verified Expert Solution
Link Copied!

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 20
question multiple choice test and a minimum passing score is 15 out of 20.
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:
1. A
2. C
3. A
4. A
5. D
6. B
7. C
8. A
9. C
10. B
11. A
12. D
13. C
14. A
15. D
16. C
17. B
18. B
19. D
20. A
The external file of student scores is provided with the assignment (StudentResponses.txt). Be sure
to copy this text file into your DriversLicenseExam2 project folder. The data contained in the file is:
MARK,A,A,A,A,B,B,C,A,C,A,A,D,C,A,B,C,B,B,B,D
MIKE,A,C,A,A,D,B,C,A,C,B,A,D,C,A,D,B,B,B,C,A
JOHN,A,C,B,B,C,B,C,A,C,B,B,C,C,B,C,C,B,B,D,A
MARY,A,C,A,A,D,B,C,A,C,B,A,D,C,A,D,C,B,B,D,A
ELLEN,B,B,B,A,C,B,C,A,B,B,A,D,C,A,D,C,C,C,D,A
MARK,A,A,A,A,B,B,C,A,C,A,A,D,C,A,B,C,B,B,B,D
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 (i.e., 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 3 Lnai 6323

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

3642159389, 978-3642159381

More Books

Students also viewed these Databases questions

Question

How may mindfulness enhance sport performance?

Answered: 1 week ago

Question

Describe the types of power that effective leaders employ

Answered: 1 week ago

Question

Describe how leadership styles should be adapted to the situation

Answered: 1 week ago