2016-03-25 16:47:20 -07:00
# speed button quiz answers
2016-04-01 16:22:47 -07:00
counter that keeps track of how many times button "A" has been pressed.
2016-03-25 16:47:20 -07:00
2016-04-13 08:27:45 -07:00
This is the answer key for the [speed button quiz ](/lessons/speed-button/quiz ).
2016-03-25 16:47:20 -07:00
## 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.
2016-03-30 16:43:56 -07:00
```blocks
2016-03-25 16:47:20 -07:00
let count = 0
```
![](/static/mb/lessons/speed-button-0.png)
## 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.
2016-03-30 16:43:56 -07:00
```blocks
2016-03-25 16:47:20 -07:00
let count_ = 0
2016-03-29 21:17:57 -07:00
input.onButtonPressed(Button.A, () => {
2016-03-25 16:47:20 -07:00
count_ = count_ + 1
basic.showNumber(count_, 100)
})
```
< br / >
![](/static/mb/lessons/speed-button-1.png)
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.
2016-03-30 16:43:56 -07:00
```blocks
2016-03-31 17:39:17 -07:00
let count_ = 0
2016-03-29 21:17:57 -07:00
input.onButtonPressed(Button.A, () => {
2016-03-25 16:47:20 -07:00
count_ = count_ + 1
basic.showNumber(count_, 100)
})
```
![](/static/mb/lessons/speed-button-2.png)
After five button presses, **count** will be equal to 5.