45 lines
1.1 KiB
Markdown
45 lines
1.1 KiB
Markdown
|
# transformers quiz
|
||
|
|
||
|
Use functions to return values #LED #number #math #functions #return #docs
|
||
|
|
||
|
## Name
|
||
|
|
||
|
## Directions
|
||
|
|
||
|
Use this activity document to guide your work in the [transformer tutorial](/microbit/lessons/transformer/tutorial)
|
||
|
|
||
|
Answer the questions below while working on or after you finish the tutorial. Pay attention to the dialogs!
|
||
|
|
||
|
## 1. What is a 'function'?
|
||
|
|
||
|
## 2. Consider the following directions
|
||
|
|
||
|
Write the line of code to create a number variable that is initially 5.
|
||
|
|
||
|
<br/>
|
||
|
|
||
|
## 3. Consider the following directions
|
||
|
|
||
|
Write the line of code to use the condition 'on button pressed ("A")'
|
||
|
|
||
|
<br/>
|
||
|
|
||
|
## 4. Consider the following directions
|
||
|
|
||
|
Write the code that creates a function.
|
||
|
|
||
|
<br/>
|
||
|
|
||
|
## 5. Consider the following directions
|
||
|
|
||
|
Write the code to call the function that doubles the input number. (the function is going to provide the doubled value after it is called). The code will assign the new value (10) to a variable which we will call `doubled`.
|
||
|
|
||
|
<br/>
|
||
|
|
||
|
## 6. Consider the following picture
|
||
|
|
||
|
Write the code to show number 20 on the BBC micro:bit. Please add the variable called `doubled` Refer to the finished code on the tutorial.
|
||
|
|
||
|
<br/>
|
||
|
|