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...
Program a math quiz on Python Specifications: - The program should ask the user a question...
Program a math quiz on Python Specifications: - The program should ask the user a question and allow the student to enter the answer. If the answer is correct, a message of congratulations should be displayed. If the answer is incorrect, a message showing the correct answer should be displayed. - the program should use three functions, one function to generate addition questions, one for subtraction questions, and one for multiplication questions. - the program should store the questions and...
Write a C++ program to read in various types of test questions (multiple choice and True/False)...
Write a C++ program to read in various types of test questions (multiple choice and True/False) from a test bank (text file), and load the questions into an array of questions. You will need to implement the following class hierarchy (given in UML): Once the test bank has been loaded, simply iterate over the array of questions and have each question printed out to the screen. The test bank (text file) will have the following format: Line 1 will be...
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...
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...
Develop a python program to ask the user to take up the quiz(General knowledge) which has...
Develop a python program to ask the user to take up the quiz(General knowledge) which has around 4 or 5 questions & choices for those questions. For each question user should have 2 or 3 attempts suppose if they are wrong. Develop the in such a manner to add few more questions and remove some questions.
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...
Please answers the below True/False and Multiple choice questions from Business Law. (Please provide a brief...
Please answers the below True/False and Multiple choice questions from Business Law. (Please provide a brief explanation to answers if possible) Chapter: Agency Relationships 1. “By definition, independent contractors are not employees.” True/False 2.   John lies and tells Bill that he, John, is Mike's agent, when he is not. Bill enters into a contract with John for the benefit of Mike. Mike can still ratify the contract John entered into for him. True/False 3. In #2 above, when John lied,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT