Program 2 - Food Quiz

People enjoy taking quizzes. This week we will write an interactive quiz on some food-related topic.

Your quiz should be made of at least four and no more than seven multiple-choice questions. After someone takes your quiz, the program should tell them their score and add a sentence explaining what the score means.

The score should be an integer greater than or equal to zero.

You quiz can be about anything food-related. Some ideas:

Example output

Here's what happens when I run my quiz program. Blue is what Python types and black is what the user responds.

Sicilian Food Quiz

A cannoli is
a) a stuffed pasta dish
b) a dessert involving ricotta cheese
c) a small white bean
Answer:
c

'Scarol is
a) a green vegetable, good in soup
b) a spicy pork product
c) like a cream puff
Answer:
c

Pesto is
a) Sicilian for pasta
b) good with meatballs
c) a Northern Italian abomination
Answer:
b

Your score is 0.
Mama mia!

Type enter to exit.

Getting Started

Get the technical aspects of making a quiz done first, and then worry about making your questions interesting and fun.

You could begin by printing some questions and getting answers, and printing the answers back out to make sure you are getting them properly.

Then think about how to score the answer to each question as you go along, how to keep track of the total score so far at every question, and what to print out at the end. You will probably need a variable called "score"!

Grading

Most of your grade on this quiz will be based on how well the program works; does it run at all, does it fail if it is given nonsense answers, is the score always correct? A techincally perfect program will get 90 out of 100 points. The remaining ten points will be given based on the content: is it fun to take? did we learn something (about food or about ourselves) by taking it?

Saving and handing in the program

Like last time, hand in your program (the .py file) using SmartSite.

If you are working in Hutchinson, remember to save your program somewhere before you go!