Question

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:

  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 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.

Additional Requirements

  • The user's entries will be case insensitive. A lowercase a will be treated the same as a capital A. (Note: turn the users answer into the uppercase version of their answer).
  • When displaying the wrong answers, all answers should be displayed as capital letters (see screenshot).
  • You program should not crash if the user does not enter an answer (hits the enter key). Besides this your program does not need to be defensive. For example, if the user enters a Z or a multi-character answer you do not need to tell the user that they entered a nonsense answer. Treat this as a wrong answer.
  • The wrong answers must be displayed in a chart like the screenshot. Note that the values are displayed centered on there heading (as close as possible). All answers should be capitalized.
  • You will have 20 assignment statements to initialize the correct answer array. Normally we would not hard code the answers into the program like this, but at this point that's all we know how to do. You can use a single comment to cover all 20 lines.
  • Your program must use one or more loops for prompting the user for answers and check their answers. You may not copy, paste, and tweak twenty times for this.

Notes

  • You will need two parallel arrays for this assignment. You may use a third array if you want.
  • Your arrays will all be one dimensional.
  • I suggest that you use three loops for your assignment:
    1. The first loop should prompt the user for their twenty answers. It should also capitalize their answer.
    2. The second loop should calculate the number or correct and incorrect answers.
    3. The third loop should display the incorrect answers.

You may combine the first and second loops together if you like.

SAMPLE OUTPUT:

What is the answer for question 1: A

What is the answer for question 2: d

What is the answer for question 3: A

What is the answer for question 4: apple

And so on until it asks for 20 answers

*****PASSED*****

Number correct:   

Number incorrect:

You got the following questions wrong:

Question. Your Answer Correct

then list under each header the question number answer inputed and what the correct answer is

Notes

  • You can use the copy & paste method to enter test data. This makes testing easier. Make sure I show this to you before you leave class.
  • Remember that you cannot use global variables in this class. Do not declare your array outside of main()).
  • Don't forget that you are not allowed to use break, continue, or System.exit() in this class. You may also not use return inside of main()(which is essentially the same as an exit).
  • I suggest you write this program as one big main() procedure. Do not use other procedures or functions. I know this is at odds with the best practices of modular programming (chapters 3 and 6), but in this case you will avoid the problems by reference variables and passing arrays as parameters.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

answers = [ "B","D","A","A","C","A","B","A","C","D","B","C","D","A","D","C","C","B","D","A" ]
print("Please input your answers");
users=[]
i=0
while(i<20):
print("What is the answer for question ",i+1)
users.append(input().upper())
i=i+1

score=0;
answersList=[]
i=0
while(i<20):
if(answers[i]==users[i]):
score=score+1
else:
answersList.append(i+1)
i=i+1
  
print("Your Score : " , score);
if (score>=15):
print("You Passed...!!!");
else:
print("You Failed");
print("Number correct : ",score)
print("Number Incorrect : ",20-score)

print("You got the following questions wrong : ",answersList);
  

  

Add a comment
Know the answer?
Add Answer to:
A - Write pseudocode B - Write A PYTHON PROGRAM Driver’s License Exam The local driver’s...
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
  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • Write a Java program, including comments, to compute statistics for how students did on an exam....

    Write a Java program, including comments, to compute statistics for how students did on an exam. The program should compute various things about a student and print it all out. Then it repeats the process for each new student until the entire set of data has been completed. (a) The program reads in and prints the ID number of a student [see step (g) below] and then the number of right answers and the number of wrong answers. (The total...

  • [Using Python] Create a program to generate one random question, from a list of 5, for...

    [Using Python] Create a program to generate one random question, from a list of 5, for each repeated run. Report the number of the correct answers after all five questions have been answered. Your 5 questions should be a simple math problem, like "what is 5-4?" use a while loop based on the number of questions use a counter variable to count the number of questions asked e.g. questionCount +=1 user a counter variable to keep track of the correct...

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