WorksheetsIntroduction to Algorithms and Programming Concepts
Total questions: 40
Worksheet time: 20mins
What is an algorithm?
A picture the computer displays
A set of steps used to solve a problem
A type of computer hardware
A variable that stores numbers
What is an example of an input?
A label showing text
A user tapping a button
A notifier message
A procedure running
What is an example of an output?
User typing into a textbox
User tapping a button
An image displayed on the screen
The phone vibrating when a condition is met
An event is...
Something that happens and triggers code
A list of values
A loop that runs forever
A type of variable
The block when Button.Click do runs when...
The user types text
The user taps that button
The app starts
The list is updated
Which block stores a value the app can change later?
Procedure block
Event block
Variable block
Output block
Which of the following is the BEST example of output?
A user selecting from a ListPicker
An image displayed on the screen
A user tapping a button
A label showing text
What is procedural abstraction?
Storing data in a list
A simplified version of hardware
Grouping code into a reusable procedure
A way of adding images to your app
Why do programmers use procedures?
To slow down the app
To avoid repeating code
To store pictures
To erase variables
Which of the following is a Boolean expression?
20 + 5
“Hello”
x > 10
3.14
Which block allows a program to make decisions?
Loop
Procedure
If/then/else
Join text
The expression TextBox.Text = "" checks whether...
The user typed a number
The textbox is empty
The textbox is disabled
The textbox should reset
What does set global score to global score + 1 do?
Replaces the score with 0
Adds 1 to the score
Displays the score
Deletes the score
Which BEST describes a variable?
A reusable block of code
A storage container for values
A device event
A screen layout component
In an if/else statement, the else part runs when...
The condition is true
The app crashes
The condition is false
The user clicks reset
Logic that checks multiple conditions in order is called...
Nested loops
Sequential selection
Boolean storage
Data abstraction
The block not (TextBox.Text = "") means...
The textbox is blank
The textbox is not blank
The textbox contains a number
The textbox resets itself
A good reason to use an if/else-if/else structure is...
When you only need one condition
When the program should repeat forever
When output can vary based on conditions
When no conditions are needed
A list is best described as...
One piece of text
A single number
A collection of related values stored together
The output of a loop
What does “add items to list” do?
Removes an item
Adds a value to the end of a list
Sorts the list
Changes the first item only
If a list is [“Red”, “Blue”, “Green”], what does index 2 return?
Red
Blue
Green
Error
Why must FlavorList and VoteList stay aligned?
To keep the app looking nice
So each flavor’s votes match the correct flavor
To prevent errors in the code
To ensure the lists are the same length
What happens when a ListPicker opens?
The list is deleted
The list’s items are shown to the user
A new item is added
A timer starts
What does “index in list” return?
The last item
The location of an item in the list
The list length
Whether the item is a number
If a user selects “Mint” in [“Chocolate”, “Vanilla”, “Mint”], index =
0
1
2
3
What does increasing VoteList[index] by 1 do?
Adds a new flavor
Increases the selected flavor’s vote count
Deletes the flavor
Sorts the list
Why use UPCASE when adding flavors?
It encrypts text
It standardizes comparison
It forces lowercase
It sorts the list
A BEST-SO-FAR loop is used to...
Add items
Find the largest/smallest value
Display images
Reset variables
The design view is used to...
Build the user interface
Store list values
Write algorithms
Configure phone hardware
ListPicker.AfterPicking runs when...
The app starts
The user taps a button
The user selects an item
A timer ends
An example of output is...
A textbox waiting for input
A label displaying text
A button before it’s tapped
A screen changing color
A TextBox is used primarily for...
Displaying messages
Letting the user enter text
Showing lists
Running procedures
Which block updates what the user sees?
get global
set Label.Text to
add items to list
call procedure
The join block...
Adds numbers
Combines text pieces
Sorts values
Stores images
A notifier is used to...
Add data
Display alerts
Run loops
Control sprites
Event-driven programming means...
Code runs only in order
Code runs when events happen
Code never stops
Code ignores user actions
Which conditional checks if the user typed a number?
text = ""
is number?(text)
text > 100
list is empty
Which block prevents voting without a flavor selected?
if selection = ""
join text
disable button
reset screen
A reset button should use which event?
ListPicker.AfterPicking
Button.Click
Screen.Initialize
Notifier.AfterChoosing
Using one procedure multiple times is an example of...
List storage
Event handling
Procedural abstraction
Variable scope
