Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

** We are using PYTHON language. If you can please take screenshots of your complete code or an easy way to read your code. Thank

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

** We are using PYTHON language. If you can please take screenshots of your complete code or an easy way to read your code. Thank you!

c) Suppose a class takes a multiple-choice test. We're going to experiment with alternative scoring mechanisms. For this problem you'll want to say from random import (and use the methods randrange and choice, which you can look up in the text or using helpCrandom) Let's say you have these three global constants defined (a complete program might determine these values from reading a file; we're just doing it this way for convenience): NUMBER_OF STUDENTS 200 NUMBER OF_QUESTIONS20 NUMBER-OF-CHOICES-4 # 3 choices is A/B/C, 4 choices is A/B/C/D, 5 is A/B/C/D/E Use the identifiers NUMBER_OF_STUDENTS, NUMBER_OF_QUESTIONS, and NUMBER_OF_CHOICES in your code rather than the hard-coded constants 200, 20, and 4. And of course your code should work correctly when different values are assigned to these identifiers (C.1) Write a function called correct-answers that generates and returns a string of letters representing the correct answers to the test. Of course answers to real tests aren't chosen randomly! We're just doing it this way to produce some test data to use when we score students' answers.) The length of the string should be the number of questions; each character in the string should be chosen randomly from the first n letters of the alphabet (where n is the number of choices). [Use the choice method. Call correct_answers to produce the answers we'll use; assign the result to another global constant called ANSWERS

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

Step: 3

blur-text-image

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Is the person willing to deal with the consequences?

Answered: 1 week ago

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago