pxt-calliope/olddocs/lessons/magic-8/quiz.md
Tom Ball f4eca66648 move lessons out of web site
will move select lessons back to "educators" section
2016-06-14 11:49:58 -04:00

777 B

magic 8 quiz

create a magic 8 ball on the BBC micro:bit.

Name

Directions

Use this activity document to guide your work in the magic 8 tutorial.

Answer the questions while completing the tutorial. Pay attention to the dialogues!

1. Define what an 'if statement' is.


2. Create a Variable called x and assign it to a random number between 0 and 2.


3. Write the 'if statement' to check if x is equal to 2. Inside the 'if statement', display the string "Yes".


4. Write the 'if statement' to check if x is equal to 1. Inside the 'if statement', display the string "No."


5. Write the code to display the string "I don't know" if the Variable x is neither 2 nor 1.