pxt-calliope/docs/reference/js/lessons/transformer/quiz.md
2016-04-13 08:27:45 -07:00

1.1 KiB

transformers quiz

Use functions to return values.

Name

Directions

Use this activity document to guide your work in the 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.


3. Consider the following directions

Write the line of code to use the condition 'on button pressed ("A")'


4. Consider the following directions

Write the code that creates a function.


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.


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.