WorksheetsSwift Programming Review 1
Total questions: 15
Worksheet time: 8mins
Runs a block of code over and over for a set number of times.
For Loops
Sequence
Composition
Call
A collection of commands grouped together and given a name. The set of commands can then be run with just the name of the set whenever it is needed.
For Loop
Function
Sequence
Composition
The process of identifying and fixing the error.
sequence
composition
debugging
bugging
_________________ is telling a computer what to do.
Call
Commands
Coding
Composition
A specific action for the computer to perform.
sequence
function
command
loop
The order in which the commands are given.
sequence
composition
command
function
An mistake in your code.
error
malfunction
debug
bug
Telling a program to run a function.
command
call
sequence
coding
How many time would you loop this code in order for Mario to collect all of the stars:
moveForward( )
moveForward( )
collectStar( )
turnRight( )
1
2
3
4
Which of the following is the correct code for Byte to collect a Gem?
collectGem ( )
CollectGem ()
collectGem
Collect Gem ( )
Commands have no spaces between words and always end with:
colon
parentheses
spaces
semicolons
You identified a repeating pattern in this puzzle and created a function that solves one instance of the pattern. Which of the following could be used to run the function until the puzzle is solved?
for i in 1…12
for i in 1…6
for i in 1…4
for i in 1…5
Which of the following should be deleted from the sequence to solve the puzzle?
toggleSwitch()
moveForward()
for i in 1…4 {
turnRight()
()After identifying a pattern of this puzzle, one of your students wants to define a function that will send Byte to collect a single Jen and return to the original center position. Which of the following could be added to “func SolveStair()” to achieve the students objective? Remember that there are multiple ways to solve a puzzle.
moveForward()
collectGem()
turnAround()
moveForward()
moveForward()
turnAround()
moveForward()
collectGem()
turnRight()
moveForward()
collectGem()
turnRight()
moveForward()
turnAround()
moveForward()
turnAround()
collectGem()
moveForward()
