pxt-calliope/docs/reference/js/lessons/transformer/quiz.md

45 lines
1.1 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# transformers quiz
2016-04-02 01:22:47 +02:00
Use functions to return values.
2016-03-26 00:47:20 +01:00
## Name
## Directions
2016-04-13 17:27:45 +02:00
Use this activity document to guide your work in the [transformer tutorial](/lessons/transformer/tutorial)
2016-03-26 00:47:20 +01:00
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/>