Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*PYTHON* The local drivers license office has asked you to write a program that grades the multiple-choice questions in a drivers license writing quiz. The

*PYTHON*

The local drivers license office has asked you to write a program that grades the multiple-choice questions in a drivers license writing quiz. The quiz has 10 multiple-choice questions. Here are the correct answers:

1. B

2. A

3. C

4. C

5. B

6. A

7. D

8. C

9. D

10. C

Your program should store the correct answers shown above in a list. It should ask the applicant to enter his answers for each of the 10 questions, and the answers should be stored in another list. After the applicants answers have been entered, the program should display a message indicating whether the applicant passed or failed the quiz. An applicant must correctly at least answer 7 questions to pass. It should then display the total number of correctly answered questions, the total number of incorrectly answered questions.

Please assign the following functions:

  1. getInput(inputList)
  2. checkAnswers(userlist, correctAnswerList, rightQuestions, wrongQuestions)

The getInput function accepts a list and asks the user to input answers to the quiz and stores them in the list. The Input Validation loop is required for only validates A, B, C, D, a, b, c, d, as input.

The checkAnswers function receives 4 parameters; the applicant's answers the correct answers and an empty list for the applicant's right answers and an empty list for the applicant's wrong answers. It compares the values in the correct answers list to the values of the applicant's list. It updates the right answers list and wrong answers list. Then, returns the number of correct answers to the main function.

For instance:

Enter your answers Question1:C Question2:B Question3:A Question4:D Question5:a Question6:c Question7:o Please enter a valid answer. Question7:D Question8:B Question9:a Question10:c You have 8 incorrect answers.

You have 2 correct answers. The wrong questions are: [1,2,3,4,5,6,8,9] The right questions are: [7,10]

You failed the quiz.

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

How should Grandview go about implementing a global PM system?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago