Migrate docs from the other repo
This commit is contained in:
50
docs/reference/js/lessons/flipping-bird/quiz-answers.md
Normal file
50
docs/reference/js/lessons/flipping-bird/quiz-answers.md
Normal file
@ -0,0 +1,50 @@
|
||||
# flipping bird quiz answers
|
||||
|
||||
use modulo with a conditional #mod #shake #variables #docs #input #mod
|
||||
|
||||
This is the answer key for the [flipping bird quiz](/microbit/lessons/flipping-bird/quiz).
|
||||
|
||||
## 1. What does "modulo" mean in math?
|
||||
|
||||
<br/>
|
||||
|
||||
Modulo (or Mod) is the remainder of a division problem.
|
||||
|
||||
## 2. Consider the following code
|
||||
|
||||
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
|
||||
```
|
||||
count = 1
|
||||
count_ = count_ + 2
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||
<br/>
|
||||
|
||||

|
||||
|
||||
The variable `count` is now equal to 3.
|
||||
|
||||
<br/>
|
||||
|
||||
## 3. Consider the following directions
|
||||
|
||||
Modulo (Mod) tells us what the remainder of a division is. For example, `15 mod 4 is 3` since 15 divided by 4 has a remainder of 3.
|
||||
|
||||
```
|
||||
count = 12
|
||||
count = math.mod(count, 5)
|
||||
```
|
||||
|
||||
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
|
||||
|
||||
<br/>
|
||||
|
||||
<br/>
|
||||
|
||||

|
||||
|
||||
The display will show `2` because the remainder of 12 divided by 5 is 2.
|
||||
|
Reference in New Issue
Block a user