WorksheetsBJC U2L1 Global vs. Local Variables
Total questions: 11
Worksheet time: 6mins
What will the script say?
50, 50, 50
50, 60, 60
50, 60, 50
60, 60, 50
A local variable is
a variable that is limited in scope
is the same as a constant
can be accessed anywhere in the program
is the same as a block
A predicate block will return...
a value of any type
nothing
true or false
a condition
Assuming age is a global variable, what will the script say?
50, 60, 50
50, 50, 50
50, 60, 60
50, 50, 60
A global variable is
accessible inside only one block in a program
accessible by only one sprite in a program
used as an input parameter
accessible anywhere within the program
"i" and "branches" are not global variables. What will the script do at "say i for 3 seconds"?
100 for 3 seconds
error
say 8 for 3 seconds
say 9 for 3 seconds
"a" is not a global variable. I will execute script 1. What happens when I execute script 2?
... 3
... 5
error
Nothing - need a hat block first
I click on script 1. "a" is a global variable set to 5.
I click on script 2.
What happens if I click on script 3?
3
5
error
nothing
x is a global variable. What will the script say?
error
nothing - x is undefined
x is 5
x is 10
x is a global variable. What will script 1 say?
x is 5
x is 10
x is 15
error
Which of these is not a "true berry"?
blackberries
gooseberries
peppers
tomatoes
