Simulation Quiz Rough Draft
Simulation quiz rough draft for lesson
questions_number = 6
answers_correct = 0
questions = [
"True or False: Simulations will always have the same result. \n A: True, \n B: False",
"True or False: A simulation has results that are more accurate than an experiment \n A: True, \n B: False",
"True or False: A simulation can model real world events that are not practical for experiments \n A: True, \n B: False",
"Which one of these is FALSE regarding simulations \n A: Reduces Costs, \n B: Is safer than real life experiments, \n C: More Efficient, \n D: More accurate than real life experiments",
"Which of the following scenarios would be the LEAST beneficial to have as a simulation \n A: A retail company wants to identify the item which sold the most on their website, \n B: A restaurant wants to determine if the use of robots will increase efficiency, \n C: An insurance company wants to study the impact of rain on car accidents, \n D: A sports car company wants to study design changes to their new bike design ",
"Which of the following is better to do as a simulation than as a calculation \n A: Keeping score at a basketball game, \n B: Keeping track of how many games a person has won, \n C: Determining the average grade for a group of tests, \n D: Studying the impact of carbon emissions on the environment"
]
question_answers = [
"B",
"B",
"A",
"D",
"A",
"D"
]
print("Welcome to the Simulations Quiz!")
def ask_question (question, answer):
print("\n", question)
user_answer = input(question)
print("You said: ", user_answer)
if user_answer == answer:
print("Correct!")
global answers_correct
answers_correct = answers_correct + 1
else:
print("You are incorrect")
for num in range(questions_number):
ask_question(questions[num], question_answers[num])
print("You scored: ", answers_correct, "/6")
questions = \
{
"1. Simulations will always have the same result": {
"A": "True",
"B": "False"
},
"2. A simulation has results that are more accurate than an experiment": {
"A": "True",
"B": "False"
},
"3. A simulation can model real world events that are not practical for experiments": {
"A": "True",
"B": "False"
},
"4. Which one of these is FALSE regarding simulations": {
"A": "Reduces Costs",
"B": "Is safer than real life experiments",
"C": "More Efficient",
"D": "More accurate than real life experiments"
},
"5. Which of the following scenarios would be the LEAST beneficial to have as a simulation": {
"A": "A retail company wants to identify the item which sold the most on their website",
"B": "A restaurant wants to determine if the use of robots will increase efficiency",
"C": "An insurance company wants to study the impact of rain on car accidents",
"D": "A sports car company wants to study design changes to their new bike design "
},
"6. Which of the following is better to do as a simulation than as a calculation": {
"A": "Keeping score at a basketball game",
"B": "Keeping track of how many games a person has won",
"C": "Determining the average grade for a group of tests",
"D": "Studying the impact of carbon emissions on the environment"
}
}
print("\nSimulations Quiz")
prompt = ">>> "
correct_options = ['D', 'C', 'D', 'B', 'A']
score_count = 0
for correct_option, (question, options) in zip(correct_options, questions.items()):
print("\n", question, "\n")
for option, answer in options.items():
print(option, ":", answer)
choice = str(input(prompt))
if choice.upper() == correct_option:
score_count = score_count + 1
print("Your score is:")
print(score_count)