Question
Goal: IN PYTHON functions with lists and tuples You are to create a program that will aid in grading a multiple choice assessment that contains
Goal: IN PYTHON functions with lists and tuples You are to create a program that will aid in grading a multiple choice assessment that contains 20 questions. Your program will compare the answers from a student to the correct answers and determine if the student answered at least 75% of the questions correctly to pass the assessment. Your program will also provide an output listing the correct answers, the students answers, and whether the students answers were correct. The answers will be upper case letters A through E and you may assume the student answered all 20 questions. Your program should employ 3 functions other than main (which will act as a driver for the other functions). The first of these 3 functions should be used to input the students answers. This function should not accept any parameters and will return a list containing upper case characters for the students answers. Inside this function use a loop to prompt the user to enter the students responses to the 20 questions one at a time and stored the students responses in a list. You may assume that the user will input an appropriate upper case character for the students response. Once the loop is finished, the list of students responses should be returned to the function call. The second of these functions will compare the students answers to the correct answers and count how many answers are correct. This function should accept 2 parameters (a tuple of correct answers and the list of students answers), and will return the string Passed when the student answers at least 15 questions correctly. When the student answers fewer than 15 questions correctly, the string Failed should be returned. A loop should be used to count the number of questions the student answered correctly and should be returned to the function call along with the string. Note two items are being returned to the function call: the string indicating that the student passed or failed and the number of questions the student answered correctly. The third function will output the correct answers, the students answers and whether the students answers were correct in table. This function should accept two parameters (the tuple of correct answers and the list of students answers) and will not return anything to the function call. Using a loop the function should output the question number, the correct answer, the students answer, and either the string correct or incorrect. (See below for an example) Sample output: Question 1: Expected Answer: B Students Answer: C Incorrect Question 2: Expected Answer: D Students Answer: D Correct Question 3: Expected Answer: A Students Answer: A Correct Labs 3-6 Makeup 2 CMPSC 101-Spring 2018 Question 4: Expected Answer: E Students Answer: E Correct Question 5: Expected Answer: C Students Answer: E Incorrect In your main function you should create the tuple of correct answers by a simple assignment statement. Next call the function to input the students responses. Then call the function to compare the tuple of correct answers with the list of student responses and to count the number of correct answers by the student. Output the number of questions the student answered correctly and whether the student passed or failed. Next your main function should ask the user if he/she would like to see a detailed report of the correct answers and the students responses. If the user wants to see the report, call the function to output the results as shown in the sample output above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started