Page 17 - Touchcode_C7_Flipbook
P. 17
Step 4: Click on ‘Variables’, select ‘Make a variable...’, write the name of the variable as ‘Square’,
then click on ‘Ok’. Variable ‘Square’ will appear in ‘Make a Variable…’.
Step 5: From the ‘Variables’ select ‘set square to 0’ block, it will appear on the workspace.
Drag ‘set square to 0’, and drop it to the ‘on start’ block below ‘set a to 0’ block.
Step 6: From the ‘Math’ block, select ‘multiplication’ block.
Step 7: From ‘Variables’ select variable ‘a’ two times.
Step 8: Drag variable ‘a’ and drop them to both sides of ‘multiply’ block. And then drag the
multiplication block to ‘0’ of ‘set Square to 0’ block.
Step 9: From ‘Game’, select ‘splash’ block.
Step 10: Click on ‘Advanced’, select ‘Text’, and then click on ‘join’ block.
Step 11: Drag the ‘join’ block and drop it to the ‘splash’ block.
Step 12: Write the message ‘Square of a number is:’ in ‘hello’ and in ‘world’ drag the variable
‘Square’, and drop it in a ‘join’ block.
Variables in Real Life 15

