No student devices needed. Know more
25 questions
What is Swift?
A tool used to write a pseudo code for any program
Advanced tool to create applications
Powerful programming language created by Apple
An algorithmic designer tools
What best describes an algorithm?
A step-by-step series of operations
Only calculations that use advanced mathematics
The computer equivalent of rhythm
The same thing as an identifier
What is a sequence ?
Specific actions for the computer to perform.
The order in which the commands are given.
The repeated actions in a line of code.
Algorithmic thinking skills.
What is coding?
The repeated actions in the program
Algorithmic thinking skills
Telling a computer what to do.
None of the above
What is a mistake in a line of code called?
error
debug
bug
malfunction
By writing commands you give instructions to do something. Which command sequence is formatted correctly?
collectGem ( )
moveForward ( )
collect Gem ( )
move Forward ( )
(moveForward)
(collectGem)
moveForward ( ) collectGem ( )
Longer sequences of code can involve ----------------
less bugs.
more bugs.
fewer variables.
fewer actions.
Sometimes we solve coding problems by combining existing commands to create a new behavior. This process is called composition. Which is an example from Swift Playgrounds of composition?
When I told the bot to collectGem ( )
When I learned how to toggleSwitch ( )
When I created a turnRight ( ) function with three turnLeft ( ) commands.
When I write 1 line of code.
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()
Based on the image, what type of codes are used? (Select all that apply.)
Logical AND operator
Logical NOT operator
While loop with an inner while loop
Logical OR operator
While loop nested in for a loop
Commands have no spaces between words and always end with ____________.
colon
parentheses
spaces
semicolons
Which of the following is the correct code for Byte to collect a Gem?
collectGem ( )
CollectGem ( )
collectGem
Collect Gem ( )
Which is the correct code to have Byte move forward?
moveForward:
MoveForward ( )
moveFor ( )
moveForward ( )
Which command is used to turn the switch on?
toggle ( )
activateSwitch ( )
toggleSwitch ( )
onSwitch ( )
Which of the following is NOT a logical operator?
&&
||
>
!
Which of the following temperature values will give the result, as “weather is normal”?
If the temperature is less than or equal to 60 the “ weather is cold”, else “weather is normal”
60
45
0
65
Which of the following operators is used to invert the value from true to false and vice versa?
!
&&
ll
=
Which of the following code blocks is executed when the condition in an "if statement" is false?
else
if then
if
then
Which of the following represents the condition in the code segment below?
If isOnClosedSwitch {
toggleSwitch()
moveFoward()
}
if
moveFoward
toggleSwitch
isOnClosedSwitch
Which of the following will be executed when the condition is false in the code segment below?
if isOnClosedSwitch{
toogleSwitch()
turnLeft()
collectGem()
}
else
{
moveForward()
}
turnLeft()
toggleSwitch()
moveFoward()
collectGem()
Which of the following statements is true about the following loop?
While !isOnGem{
moveForward()
}
It will move forward 5 times then it will stop
It will move forward as long as there is a gem on the tile
It will move forward exactly 20 times then it will stop
It will move forward as long as there is no gem on the tile
Byte needs to turn left to reach the gem. Which of the following is the correct code to get him there?
moveForward ( )
turnLeft ( )
moveForward ( )
moveForward ( )
collectGem ( )
moveForward ( )
turnLeft ( )
collectGem ( )
moveForward ( )
TurnLeft ( )
moveForward ( )
moveForward ( )
collectGem ( )
moveForward ( )
moveForward ( )
turnLeft ( )
moveForward ( )
moveForward ( )
collectGem ( )
A search for cat AND dog will retrieve only those results that contain both keywords, not simply one or the other.
True
False
OR (II) results in true if ...
Both conditions are true
Both conditions are false
One or more conditions are true
One or both conditions are true
Explore all questions with a free account