WorksheetsPLTW Activity 1.1.4 Guess a Number
Total questions: 13
Worksheet time: 7mins
What type of variable is currentX?
local scope
global scope
None of the above
local and global scope
What kind of variable is randomX?
local scope
global scope
None of the above
local and global scope
Stored data that is only used within a small part of a program and cannot be used by other parts of the program is a
local variable
global variable
None of the above
local variable and global variable
Stored data that may be used by any part of the program is a
local variable
global variable
None of the above
local variable and global variable
Using a large number of __________ variables adds complexity to your program, because all parts of the program can change ________ variables. Using __________ variables when possible saves time in debugging.
local, local, global
global, global, local
This is an example of
Natural Language
Pseudocode
MIT App Inventor Blocks
Python
This is an example of
Natural Language
Pseudocode
MIT App Inventor Blocks
Python
Will the countdown clock, TImer, need to have a global scope or a local scope? Why? Select the best answer.
local scope because then debugging is easier
global scope because the value of Timer needs to be saved for the next Clock1.Timer event
isNumber? TextboxGuess.Text returns a
boolean
integer
float
string
Set LabelMessage,Text = "" is an example of
local variable
boolean
initialization. Clear the value of the variable at the beginning of the code block.
integer
The If ... else if ... else if ... else is an example of a .... Select the best answer.
nested if statement
chained conditional
nested if statement and chained conditional
boolean expression
TextboxMyGuess.Text = global secretNumber returns a
boolean
integer
float
string
Which variable is set to False?
Trial1
Trial2
Trial3
Trial4
Trial5
