Question

PYTHON CODE PLEASEEEEE. Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has...

PYTHON CODE PLEASEEEEE. Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has asked you to design 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.B 12.C 17.C 3.A 8.A 13.D 18.B 4.A 9.C 14.A 19.D 5.C 10.D 15.D 20.A Your program should store these correct answers in an array. (Store each question’s correct answer in an element of a String array.) The program should ask the user to enter the student’s answers for each of the 20 questions, which should be stored in another array. After the student’s answers have been entered, the program should display 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.) It should then display the total number of correctly answered questions, the total number of incorrectly answered questions, and a list showing the question numbers of the incorrectly answered questions.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Thanks for the question.

Here is the completed code for this problem. Comments are included so that you understand whats going on. Let me know if you have any doubts or if you need anything to change.

Thank You !!
=============================================================================

# store the correct answer in a list in the ascending order of the questions
correct_answers=['B','D','A','A','C','A','B','A','C','D','B','C','D','A','D','C','C','B','D','A']
# create a blank empty list to store the student answers
student_answers=[]
# run a for loop 20 times to get the answers from the student, store the answers in the empty list above
for question in range(1,21,1):
    answer=input('Question {} You answer [A,B,C or D]: '.format(question))
    student_answers.append(answer.upper())
# create two variables to count the number of correct and incorrect answers
correct_answer_count=0
wrong_answer_count=0
# go through the student answers and compare with the correct answers
# if they match increment the correct coutn by 1
# if they differ increment the wrong answers
for question in range(20):
    if correct_answers[question]==student_answers[question]:
        correct_answer_count+=1
        print('Correct Answer {0}. Your Answer {1}. 1 marks'.format(correct_answers[question], student_answers[question]))
    else:
        wrong_answer_count+=1
        print(
            'Correct Answer {0}. Your Answer {1}. 0 marks'.format(correct_answers[question], student_answers[question]))
# prints the counts
print('You answered {} questions correctly'.format(correct_answer_count))
print('You answered {} questions incorrectly'.format(wrong_answer_count))
# check if the correct count is greater or equal to 15 and print appropriate message
if correct_answer_count>=15:
    print('You passed.')
else:
    print('You failed.')

===================================================================================

# store the correct answer in a list in the ascending order of the questions correct-answers-[B, D, A, A, C, A, B

Add a comment
Know the answer?
Add Answer to:
PYTHON CODE PLEASEEEEE. Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A - Write pseudocode B - Write A PYTHON PROGRAM Driver’s License Exam The local driver’s...

    A - Write pseudocode B - Write A PYTHON PROGRAM Driver’s License Exam The local driver’s license office has asked you to design 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: B D A A C A B A C D B C D A D C C B D A Your program should store these correct answers in an array. (Store each question’s...

  • please only use import java.util.Scanner Driver's License Exam The local Driver's License Office has asked you...

    please only use import java.util.Scanner Driver's License Exam 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. A 2. D 3.В 4. B 5, C 6. В 7. A 8.В 9, C 10. D 12. C 13. D 14. B 15. D 16. С 18. A 19. D 20. B Your program should store...

  • Java: The local Driver's License Office has asked you to write a program that grades the...

    Java: 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. B  12.C  17. C    3. A   8. A  13.D  18. B    4. A  9. C  14.A  19. D    5. C  10. D  15.D  20. A    Your program should store the correct answers in an array. (Store each question's answer in an element of a String array.) The program...

  • Using C++ 1. Driver's The local driver's license office has asked you to create an application...

    Using C++ 1. Driver's The local driver's license office has asked you to create an application that grades the written portion of the driver's license exam. The exam has 20 multiple-choice questions. Here are the correct answers 16. C 17.С 18. B 19. D 20. A 1. B 2. D 3. A 12. C 13. D 14. A 15. D 7.В 9.С 10. D 5. С Your program should store these correct answers in an array. It should ask the...

  • C# Visual Studio -The local driver's license office has asked you to create an application that...

    C# Visual Studio -The local driver's license office has asked you to create an application 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 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...

  • The local driver’s license office has asked you to write a program that grades the written...

    The local driver’s license office has asked you to write a program that grades the written portion of the driver’s license Rules and Signals Test. The driver license test has 25 multiple choice questions. The set of answer keys is: 1.A 6.B 11.C 16.B 2 21.B 2.C 7.C 12.A 17.A 22.C 3.B 8.D 13.B 18.C 23.A 4.B 9.A 14.C 19.A 24.D 5.D 10.B 15.A 20.D 25.B First, the application displays messages to ask for the information of current candidate about...

  • License test The Los Angeles driver's license office has asked you to create an application that...

    License test The Los Angeles driver's license office has asked you to create an application that grades the written portion of the drivers license test. The test has 15 multiple-choice questions. Here are the correct answers (You may create your own correct answers if you like) 1. C 2. D     3. B 4. A      5. C 6. D 7. B     8. A     9. C     10. D 11. A 12. C   13. D    14. A     15. B A student must answer 10...

  • Visual Basic zoow Driver's License Exam The local Registry of Motor Vehicles oflice has asked you to create an application that grades the written portion of the driver's license exam. The ex...

    Visual Basic zoow Driver's License Exam The local Registry of Motor Vehicles oflice has asked you to create an application that grades the written portion of the driver's license exam. The exam has 20 multiplc choice questions. Her ar the orrect answers to the questions: 6. A 7.13 8. A 9. C 10. D 16. С 12. C 13. D 14. A 15. D 2. D 3. A 5, C Your application should slore the correcl answers in an array....

  • Please answer Question 4 WITH A C# PROGRAM!!!!!! THANK YOU! File Edit View History Bookmarks Tools...

    Please answer Question 4 WITH A C# PROGRAM!!!!!! THANK YOU! File Edit View History Bookmarks Tools Help Share GEP IIIA Moorhead, MN 10-Day Weathe X N NDSU Faculty and Staff | North x D C#.NET - CSCI 213: Modern Sol X VitalSource Bookshelf: Starting x + + → OO - https://bookshelf.vitalsource.com/#/books/9780134400433/cf1/6 90% *** * Cambie Meble alle... S N 10 Crosby Derek Lam ... Alterna Caviar Anti-Ag... U C# Tutorial For Beginn... BE Celsius Fahrenheit con... Charter Club Sweater. Folklorama...

  • . There are n questions on a multiple choice exam, and for each question, there are...

    . There are n questions on a multiple choice exam, and for each question, there are four choices. To pass the exam, one must correctly answer at least 70% of the questions. The student has not studied, so he/she has to resort to guessing on every question. a. Find the probability of the student passing for n = 10. b. Find the expected number of questions answered correctly for n = 20. c. Find the variance for the number of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT