Question: Create a quiz program using all the questions and answers provided below You're 3rd place right now in a race. What place are you in

Create a quiz program using all the questions and answers provided below

You're 3rd place right now in a race. What place are you in when you pass the person in 2nd place?

1st

2nd

3rd

4th

How many months have 28 days?

All of them.

1

Depends if there's a leap year or not.

2

If a leaf falls to the ground in a forest and no one hears it, does it make a sound?

Yes

No

Depends on how heavy the leaf was.

Depends on what's on the floor

There are 45 apples in your basket. You take three apples out of the basket. How many apples are left?

45

3

42

0

Mathew's father has three sons- Joseph I and Joseph II. Can you guess the name of the third son?

Mathew

Joseph III

Jerin

John

What is the name of the company that published the Mario Kart video game?

Nintendo

Electronic Arts (EA)

SEGA

Xbox

  • Show the correct answers when user selected a wrong option
  • Randomly choose a congratulatory phrase from Good job! Awesome!, Correct! when user selected a correct option
  • At the end of the quiz, show the score

Each question has four options (four possible answers). The first answer immediately after the question is the correct answer. See illustration below:Create a quiz program using all the questions and answers provided below

  1. You may assume there will always have a question followed by 4 answers and the first answer is the correct answer.
  2. However you should not assume and hardcode the total number of questions in your code. The marker may use different quiz.csv (which contains different number of questions) in marking your program.

Randomize the questions and randomize the answer choices

  1. You should not follow the question sequence given above
  2. You should not follow the answer sequence given above
  3. You should randomize both the questions and the options

the output is like this: You're 3rd place right now in a race. What place are you

so it will show all 5 questions each has a blank for user to put in their answer and there will be a total up of the score shown in the end. the programming language is python and i have done out the codes for this quiz program but i did not randomize the questions and randomize the answer choices for all this 6 questions. so after every execution, i do not want the questions sequence and answer sequence to be the same in each question. i also want to randomly choose a congratulatory phrase from Good job! Awesome!, Correct! when user selected a correct option. so when the user execute again, the phrase for that question is different even when the user get correct again such as the previous time he got correct was Goodjob! then the second time he execute the code again, it became Awesome! when he got correct. at the end i also want to show the score by example like 100.00, 33.33, 50.00

the language is python and this is the code that i have done so far:

import time

#welcome the user

print("welcome to the simple quiz game! ")

time.sleep(1)

#Chances

chances=1

print("you will have" , chances,"chance to answer correctly. please put the alphabet of the answer ")

time.sleep(2)

#score

score = 0

question_1 = print("1) How many months have 28 days? (a) 1 (b) Depends if there's a leap year or not (c) All of them (d) 2 ")

answer_1 = "c"

for i in range(chances):

answer = input("Answer : ")

if (answer.lower() == answer_1):

print("Correct! Good Job. ")

score = score + 1

break

else:

print("Incorrect! ")

time.sleep(0.5)

print(" The correct answer is ", answer_1, " ")

time.sleep(2)

question_2 = print("2) If a leaf falls to the ground in a forest and no one hears it,does it make a sound ? (a) Depends on how heavy the leaf was (b) Depends on what's on the floor (c)yes (d) No ")

answer_2 = "c"

for i in range(chances):

answer = input("Answer : ")

if (answer.lower() == answer_2):

print("Correct! Good Job. ")

score = score + 1

break

else:

print("Incorrect! ")

time.sleep(0.5)

print(" The correct answer is ", answer_2, " ")

time.sleep(2)

question_3 = print("3) There are 45 apples in your basket.You take three apples out of the basket.How many apples are left? (a) 0 (b) 42 (c) 3 (d) 45 ")

answer_3 = "d"

for i in range(chances):

answer = input("Answer : ")

if (answer.lower() == answer_3):

print("Correct! Awesome. ")

score = score + 1 break

else:

print("Incorrect! ")

time.sleep(0.5)

print(" The correct answer is ", answer_3, " ")

time.sleep(2)

question_4 = print("4) You are 3rd place right now in a race .What place are you in when you pass the person in 2nd place ? (a) 2nd (b) 4th (c) 1st (d) 3rd ")

answer_4 = "c"

for i in range(chances):

answer = input("Answer : ")

if (answer.lower() == answer_4):

print("Correct! Good Job. ")

score = score + 1

break

else:

print("Incorrect! ")

time.sleep(0.5)

print(" The correct answer is ", answer_4, " ")

time.sleep(2)

question_5 = print("5) What is the name of the company that published the Mario Kart video game ? (a) SEGA (b) Nintendo (c) Xbox (d) Electronic Arts (EA) ")

answer_5 = "b"

for i in range(chances):

answer = input("Answer : ")

if (answer.lower() == answer_5):

print("Correct! Good Job. ")

score = score + 1

break

else:

print("Incorrect! ")

time.sleep(0.5)

print(" The correct answer is ", answer_5, " ")

time.sleep(2)

question_6 = print("6) Mathew's father has three sons-Joseph I and Joseph II.Can you guess the name of the third son? (a) Jerin (b) Mathew (c) John (d) Joseph III ")

answer_6 = "b"

for i in range(chances):

answer = input("Answer : ")

if (answer.lower() == answer_6):

print("Correct! Good Job. ")

score = score + 1

break

else:

print("Incorrect! ")

time.sleep(0.5)

print(" The correct answer is ", answer_6, " ")

time.sleep(2)

#print the score

while score >=5:

print("well done! Your score was",score)

break

while score

print("Better luck next time! Your score was",score)

break

quizow. Notepad Bilo de Format View Helio You're 3rd place right now in a race. What place are you in when you pass the person in 2nd place? list End This is the correct answer Brd Ath How many months have 28 days? All of them This is the correct answet 11 Depends if there's a leap year or not. 12 Tra leaf falls to the ground in a forest and no one hears it does it make a sound? Question 1 What is the name of the company that published the Mario Kart video game? a.Nintendo b. Xbox C.SEGA d. Electronic Arts (EA) Correct! Question 2 You're 3rd place right now in a race. What place are you in when you pass the person in 2nd place? a.4th b. 3rd c. 2nd d. 1st

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!