put lessons back for Michael
This commit is contained in:
50
docs/lessons/speed-button/quiz-answers.md
Normal file
50
docs/lessons/speed-button/quiz-answers.md
Normal file
@ -0,0 +1,50 @@
|
||||
# speed button quiz answers
|
||||
|
||||
counter that keeps track of how many times button "A" has been pressed.
|
||||
|
||||
This is the answer key for the [speed button quiz](/lessons/speed-button/quiz).
|
||||
|
||||
## 1. What is a variable?
|
||||
|
||||
<br/>
|
||||
|
||||
A variable that is available throughout your main function.
|
||||
|
||||
## 2. If the rectangle below represents the BBC micro:bit, shade the area that shows the value of the variable count.
|
||||
|
||||
```blocks
|
||||
let count = 0
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 3. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after two button presses on Button A. Explain why that particular area is shaded.
|
||||
|
||||
```blocks
|
||||
let count_ = 0
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
count_ = count_ + 1
|
||||
basic.showNumber(count_, 100)
|
||||
})
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||

|
||||
|
||||
After two button presses, **count** will be equal to 2.
|
||||
|
||||
## 5. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after five button presses on Button A. Explain why that particular area is shaded.
|
||||
|
||||
```blocks
|
||||
let count_ = 0
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
count_ = count_ + 1
|
||||
basic.showNumber(count_, 100)
|
||||
})
|
||||
```
|
||||
|
||||

|
||||
|
||||
After five button presses, **count** will be equal to 5.
|
||||
|
Reference in New Issue
Block a user