Question

In: Computer Science

Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has asked you to...

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.

******Need Python code

***** Need pseudocode and flowgorithm flowchart  

Solutions

Expert Solution

Thanks for the question.

Below is the code you will be needing  Let me know if you have any doubts or if you need anything to change.

Thank You !

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

def displayResult(correct,userAnswers):

    correctelyAnswered=0
    incorrectQuestions=[]
    for i in range(len(correct)):
        if correct[i]==userAnswers[i]:
            correctelyAnswered += 1
        else:
            incorrectQuestions.append(str(i+1))

    print('Total number of correctly answered question was {}'.format(correctelyAnswered))
    print('Total number of incorrectly answered question was {}'.format(20-correctelyAnswered))
    print('Questions with incorrect answers - {}'.format(','.join(incorrectQuestions)))
    if correctelyAnswered>=15:
        print('You have passed the exam')
    else:
        print('You have failed the exam')



def main():
    correct_answers = ['B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D',
                       'A']

    user_answers=[]
    for i in range(1,21):
        answer = input('Question {:02}: Enter correct answer (A,B,C or D): '.format(i)).upper()
        user_answers.append(answer)

    displayResult(correct_answers,user_answers)

main()

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


Related Solutions

The driver’s license office DMV has asked you to write a program that grades the written...
The driver’s license office DMV has asked you to write a program that grades the written portion of the driver’s license questions. The questions has 20 multiple-choice questions. Here are the correct answers: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 B D A A A C B C D A D C C D D B A B C D Your program should store these correct answers...
The local driver's license office has asked you to design a program that grades the written...
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 list. (Store each question's correct answer in an element of a String list). The program should ask...
The local driver's license office has asked you to design a program that grades the written...
The local driver's license office has asked you to design a program that grades the written portion of the driver's license test. The test 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 list. (Store each question's correct answer in an element of a String list). The program should ask...
The local driver’s license center processes applications for driver’s license renewals through the following three steps....
The local driver’s license center processes applications for driver’s license renewals through the following three steps. First, the customer registers with the receptionist, who updates the customer’s information in the database. This first step takes 2 minutes per customer. Then the customer visits one of two cashiers to pay the associated fees for the license renewal. This takes 8 minutes per customer because several forms must be printed from the computer and signed by the customer. Finally, the customer visits...
Who knows how to do pseudocode on this topic? The local driver's license office has asked...
Who knows how to do pseudocode on this topic? 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....
A sample of 31 people took a written driver’s license exam. Two variables were measured on...
A sample of 31 people took a written driver’s license exam. Two variables were measured on them: The result of the exam (0 = fail, 1 = pass), and how much time (in hours) the person studied for the exam. Using the data, fit an appropriate regression model to determine whether time spent studying is a useful predictor of the chance of passing the exam. Formally assess the overall fit of the model. Formally assess whether time spent studying is...
You need to get a driver’s license. There is a clerk A, a clerk B, a...
You need to get a driver’s license. There is a clerk A, a clerk B, a clerk C, a clerk D, and a clerk E. Assuming that the work each clerk does is value adding, answer these two questions. Calculate the amount of time in the process that is value adding and the amount that is wait time. What is the bottleneck? Department of Motor Vehicle process: A. Check in, clerk A puts your name into the computer. Clerk A...
PYTHON IS3073 1. A group of statisticians at a local college has asked you to create...
PYTHON IS3073 1. A group of statisticians at a local college has asked you to create a set of functions that compute the median and mode of a set of numbers, as defined in Section 5.4. Define these functions in a module named stats.py. Also include a function named mean, which computes the average of a set of numbers. Each function should expect a list of numbers as an argument and return a single number. Each function should return 0...
You have to get a new driver's license and you show up at the office at...
You have to get a new driver's license and you show up at the office at the same time as 4 other people. The office says that they will see everyone in alphabetical order and it takes 20 minutes for them to process each new license. All of the agents are available now, and they can each see one customer at a time. How long will it take for you to walk out of the office with your new license?...
For this problem you should describe the algorithm using a flowchart and then write Python code...
For this problem you should describe the algorithm using a flowchart and then write Python code to implement the algorithm. You are to create a Python program file for your code. Include in your HW document a photo of your flowchart and a screenshot of your program file and the output in IDLE that results when you run the program. The algorithm: Ask the user to input their annual salary and then calculate and print the weekly salary (annual/52). I...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT