Question

In: Computer Science

Use Python, please type. A multiple-choice quiz with 5 questions. Each question has 4 possible answers...

Use Python, please type.

A multiple-choice quiz with 5 questions. Each question has 4 possible answers labelled A, B, C and D.   

After displaying the first question and the 4 possible answers, the user is asked to enter their choice. If their choice is correct, add 1 to the score, then display the next question and its 4 possible answers.

At the end of the quiz, display their score out of 5, their score as a percentage, and if they get a percentage score greater than or equal to 50, your program should output "You passed this quiz, well done!", otherwise the output is "You failed this time, better luck next time!"

Also, output the student's letter grade according to this scale:

A+  91-100      C+  65-69
A   86-90       C   60-64
A-  80-85       C-  55-59
B+  77-79       P   50-54
B   73-76       F   Below 50
B-  70-72

1. Which of the following is the name of an intermediate level language?

A: C++

B: Java

C: PHP

D: Assembly

Please enter your answer, A, B, C or D:

Answer: D

2. Which of the following is not an output device?

A: Monitor

B: Printer

C: Projector

D: Mouse

Please enter your answer, A, B, C or D:

Answer: D

3. Which of the following symbol is used for comments in Python?

A: @

B: **

C: #

D: /*

Please enter your answer, A, B, C or D:
Answer: C

4. What is the output of 13 % 3 in python 3?

A: 1

B: 3

C: 4

D: 6

Please enter your answer, A, B, C or D:
Answer: A

5. What is the output of 17//2 in python 3?

A: 7

B: 8

C: 9

D: 9.5

Please enter your answer, A, B, C or D:

Answer: B

Solutions

Expert Solution

questions = ['''1. Which of the following is the name of an intermediate level language?
A: C++
B: Java
C: PHP
D: Assembly
''', '''2. Which of the following is not an output device?
A: Monitor
B: Printer
C: Projector
D: Mouse
''', '''3. Which of the following symbol is used for comments in Python?
A: @
B: **
C: #
D: /*''', '''4. What is the output of 13 % 3 in python 3?
A: 1
B: 3
C: 4
D: 6''', '''5. What is the output of 17//2 in python 3?
A: 7
B: 8
C: 9
D: 9.5''']

answers = "DDCAB"
score = 0

for i in range(5):
print("\n",questions[i])
ans = input("Please enter your answer, A, B, C or D:")
if ans == answers[i]:
score += 1

percentage = score*100/5

if percentage >= 50:
print("\nYou passed this quiz, well done!")
else:
print("\nYou failed this time, better luck next time!")
  
if percentage >= 91:
print("Grade is A+")
elif percentage >= 86:
print("Grade is A")
elif percentage >= 80:
print("Grade is A-")
elif percentage >= 77:
print("Grade is B+")
elif percentage >= 73:
print("Grade is B")
elif percentage >= 70:
print("Grade is B-")
elif percentage >= 65:
print("Grade is C+")
elif percentage >= 50:
print("Grade is C")
elif percentage >= 55:
print("Grade is C-")
elif percentage >= 50:
print("Grade is P")
else:
print("Grade is F")

# Hit the thumbs up if you are fine with the answer. Happy Learning!


Related Solutions

quiz has 5 questions. multiple choice with 4 possible answers each. a student randomly guesses on...
quiz has 5 questions. multiple choice with 4 possible answers each. a student randomly guesses on all 5 questions. 1) what is the probability of that student getting a passing grade(60% correct is passing) 2) what is the probability of that student getting a B or better (a low B is 80%) 3) what is the probability of that student failing the quiz?
You take a quiz that consists of 5 multiple-choice questions. Each question has 5 possible answers,...
You take a quiz that consists of 5 multiple-choice questions. Each question has 5 possible answers, only one of which is correct. You will randomly guess the answer to each question. The random variable represents the number of correct answers. Construct the probability distribution for this random variable.
A multiple-choice quiz has 200 questions, each with 4 possible answers of which only 1 is...
A multiple-choice quiz has 200 questions, each with 4 possible answers of which only 1 is correct. Then the probability that sheer guesswork yields more than 30 correct answers for the 80 of the 200 problems about which the student has no knowledge is equal to
A pop quiz has two questions. Question 1 is a multiple choice question with 4 possible...
A pop quiz has two questions. Question 1 is a multiple choice question with 4 possible answers. Question 2 is a true/false question. One student is completely unprepared for the quiz and has to guess the answers. Let X denote the number of questions answered correctly. 1. List all possible results for the student's quiz and their probabilities. Use C to denote a correct answer and I to denote and incorrect answer. 2. List the possible values for X. 3....
A multiple choice test consists of 60 questions. Each question has 4 possible answers of which...
A multiple choice test consists of 60 questions. Each question has 4 possible answers of which one is correct. If all answers are random guess, estimate the probability of getting at least 20% correct.
An exam has 8 multiple choice questions. Each question has 4 possible answers, only one of...
An exam has 8 multiple choice questions. Each question has 4 possible answers, only one of which is correct. If a student takes this exam and answers all questions at random, what is the probability that the student answers (a) only the first and the last question correctly? (b) only 2 questions correctly? (c) at least 2 questions correctly?
Your instructor administers a 5 question multiple choice test. Each question has 4 possible answers of...
Your instructor administers a 5 question multiple choice test. Each question has 4 possible answers of which 1 answer is correct. Find the probability of getting at least 1 question correct You and 5 friends are interested in forming a club. How many different ways can a President, Treasurer and Secretary be selected? A journalist has 10 books to review. Of the 10 books being reviewed, he can select 4 reviews for publication. How many ways can the 4 reviews...
A quiz consists of 20 multiple choice​ questions, each with five possible​ answers, only one of...
A quiz consists of 20 multiple choice​ questions, each with five possible​ answers, only one of which is correct. If a student guesses on each​ question, what is the mean and standard deviation of the number of correct​ answers? Round to the nearest thousandth. ______________________________________________________________ A. The mean is 10. The standard deviation is 3.162. B.The mean is 4. The standard deviation is 1.789. C.The mean is 10. The standard deviation is 1.789. D.The mean is 4. The standard deviation...
Isabel is taking a multiple-choice question quiz. The quiz has 7 questions and each question has...
Isabel is taking a multiple-choice question quiz. The quiz has 7 questions and each question has 4 possible answers (only one of them is a correct answer). Since she didn’t study at all, she will guess all the questions. Let X be the random variable representing the number of answers she’ll guess correctly. (3 pts) What values does X take on? (4 pts) Calculate the probability that she guesses 2 questions correctly. (4 pts) Calculate the probability of passing the...
On a multiple choice test with 18 questions, each question has four possible answers, one of...
On a multiple choice test with 18 questions, each question has four possible answers, one of which is correct. For students who guess at all answers, find the variance for the number of correct answers.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT