pxt-calliope/olddocs/js/lessons/transformers/quiz.md

41 lines
1.1 KiB
Markdown
Raw Permalink 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 [transformers tutorial](/lessons/transformers/tutorial)
2016-03-26 00:47:20 +01:00
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. What is a 'function'?
<br/>
## 2. Write the line of code to create a number variable called **x** that is equal to 5.
<br/>
## 3. Write the line of code to create a condition for 'on button pressed ("A")'
<br/>
## 4. Write the steps to create a function.
<br/>
## 5. Create a function called **double** that will double whatever input parameter is passed into it.
<br/>
## 6. Consider the following directions. Call the function that doubles the variable original. The function is going to return the doubled value after it is called. Assign the new value (10) to a variable which we will call doubled.
<br/>
## 7. Refer to Question 6. Write the code to call the function that doubles our new variable doubled. Assign the new value 20 to a variable we will call doubled twice.
<br/>