Question

In: Computer Science

Develop an interactive quiz. It should ask the user three multiple-choice or true/false questions about something....

Develop an interactive quiz. It should ask the user three multiple-choice or true/false questions about something. It must keep track of how many they get wrong, and print out a "score" at the end. (Assume data sensibly and also describe it question 2 )


OUTPUT :


Are you ready for a quiz ? Y

Okay, here are the questions!

Q1) Which is the biggest animal?

1) Tiger
2) Rat
3) Elephant
>3
That’s right!
Q2) What is the result of 9+6/3?
1) 5
2) 11
3) 15/3
>2
That’s correct!
Q3) Can you store the value “hello” in a variable of type double?
1) Yes
2) No
>1
Sorry, “hello” is a string. Double can only store floating point numbers.
Overall, you got 2 out of 3 correct.
Thanks for playing !

Solutions

Expert Solution

PYTHON CODE::

a = input("Are you ready for quiz?")
if a == 'Y' or a == 'y':
score = 0
print("\nOkay, here are all questions!")
print("\nQ1) Which is the biggest animal?\n1) Tiger\n2) Rat\n3) Elephant\n>",end="")
ans = int(input())
if ans == 3:
print("That's right!")
score += 1
else:
print("Sorry, Elephant is the correct answer.")
print("Q2) What is the result of 9+6/3?\n1) 5\n2) 11\n3) 15/3\n>",end="")
ans = int(input())
if ans == 2:
print("That's correct!")
score += 1
else:
print("Sorry, here 11 is the correct answer!")
print("Q3) Can you store the value “hello” in a variable of type double?\n1) Yes\n2) No\n>",end = "")
ans = int(input())
if ans == 2:
print("That's correct!")
score += 1
else:
print("Sorry, “hello” is a string. Double can only store floating point numbers.")
print("Overall, you got",score,"out of 3 correct.")
print("Thanks for playing !")
else:
print("Please try the quiz again")

SCREENSHOTS::


Related Solutions

Binomial Probabilities A multiple-choice quiz consists of n = 10 questions in the form True or...
Binomial Probabilities A multiple-choice quiz consists of n = 10 questions in the form True or False. Mary assumes that her comprehension level is p = 0.70, so that is the chance that she picks up a right answer. Let M denote a number of questions Mary answered correctly. Suppose that all TEN trials are independent. Answer questions below using answers in the multiple-choice format. No calculation is required here. Just recognize the proper formula for each case. A: (10)...
PART 6: True or false and multiple-choice questions Question 16: True or false, firms in situation...
PART 6: True or false and multiple-choice questions Question 16: True or false, firms in situation of monopolistic competition have deadweight losses associated with monopoly because of barriers to entry. Question 17: Which of the two demands functions below is most elastic A) Qa=100-2p B) Qb=120-p Question 18: If a buyer values an object for $4 and a seller’s cost is $1, which of the statements below is false! If a transaction takes place, total surplus will be equal to...
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...
Mary's Final for Psychology has 10 True/False questions and 10 multiple choice questions with 4 choices...
Mary's Final for Psychology has 10 True/False questions and 10 multiple choice questions with 4 choices for each answer. Assuming Mary randomly guesses on every question: a.) What's the probability that she gets at least 6 of the 10 true/false questions correct? b.) What's the probability that she gets at least 6 of the 10 multiple choice questions correct? c.) If the multiple choice questions had 5 choices for answers instead of 4, what's the probability that she gets at...
Steve is about to write a test with 10 true or false questions and 15 multiple...
Steve is about to write a test with 10 true or false questions and 15 multiple choice questions. Steve has been studying hard so we’ll give a 75% chance of getting any of the 25 questions right. Assume all the questions are independent of each other. (a) (2 points) What is the probability that Steve gets exactly two thirds of the multiple choice questions right? (b) (3 points) What is the probability that Steve gets exactly half the true or...
ALL MULTIPLE CHOICE THREE Questions Which of the following is true of sexual reproduction? The sex...
ALL MULTIPLE CHOICE THREE Questions Which of the following is true of sexual reproduction? The sex chromosomes are called X and Y Human females have a homologous pair of X chromosomes (XX) Human males have one X and one Y chromosome The 22 pairs of chromosomes that do not determine sex are called autosomes All of the above are correct Which of the following is true? Diploid cells have two chromosomes If a diploid cell undergoes meiosis, the resulting cells...
what question can I ask my genetics class about immunogenetics. multiple choice questions with elaborate answers....
what question can I ask my genetics class about immunogenetics. multiple choice questions with elaborate answers. 2 examples please
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 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...
A psychology quiz consists of ten multiple choice questions (each question is of worth 1 mark)...
A psychology quiz consists of ten multiple choice questions (each question is of worth 1 mark) with 5 options per question. A student knows the correct answer to 5 of the questions, can rule out 1 option in 3 questions, can rule out 2 options in 1 question, can not rule out any options in 1 question. What are the expected marks that the student would get?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT