Font size
WorksheetsSwift Y9 Summative Assessment Term 2
Total questions: 50
Worksheet time: 25mins
What is Swift Playground?
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 is a sequence ?
specific actions for the computer to perform
Is the order in which the commands are given
is the repeated actions
is the 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 are bugs?
application interface
errors while coding
fixing the errors
the order of actions
A list of steps that you can follow to finish a task
To do list
schedule
algorithm
directions
longer codes can involve ----------------
less bugs
more bugs
fewer variables
fewer actions
With the following code, what would you expect to see happen when you run your code?
func saySomething ( ) {
print ("Functions are awesome")
saySomething ( )
}
saySomething ( )
Functions are awesome, once
Functions are awesome, twice
Functions are awesome, repeated over and over and over...
Nothing
For loops can be useful for
fastening a handle made of rope
encircling an object
running a block of code over and over for a set number of times
keeping a privileged group informed
The IDE used in Swift is:
Swiftc
Gas
Xcode
Ld
To create Contants in Swift we use keyword ...
Conts
Contants
Let
None Of Above
Commands have no spaces between words and always end with:
colon
spaces
parentheses
semicolons
What is conditional code?
A command block
A command which will only run of it is true
A command which will only run if it is false
What is a Boolean?
A value that can only be false
A value which can only be true
A value that can only be true or false
Which of the following is NOT a logical operator
AND
NOT
IF
OR
Which of the following is/are true about variables?
I. Every variable has a name and a value
II. The content of a variable can change
III. The variable’s value can be found by using the correct variable name
I only
II only
III only
I, II and III
Which of the following is a correct statement that declares and assigns a value of 10 to a variable named total in Swift Playground App?
new total ==10
variable total =10
var total =10
let total =10
What would be the result of the code below given that grade 11 and mark 75?
If grade = 9 && mark >=60 {
You are promoted to grade 10
}
Else if grade = 10 or mark >=60 {
You are promoted
}
You are promoted
You are promoted to grade 10
You are promoted to grade 10
You are promoted
no result
Which of the following logical operator means "Equals"?
=
!=
==
>=
Good morning
Good afternoon
Good evening
What code is missing?
collectGem()
toggleSwitch()
turnRight()
moveForward()This is a correct answer
How many times should this FOR loop repeat?
2
5
1
none
What type of variable will be initialised here?
Boolean
Integer
String
Double
What type of variable
Boolean
Integer
String
Double
IF statement is
a code structure used to run code based on the value
is a collection of functions
is a pattern
none of them
Else if is
used to check a condition that isn't check by the if block
A pattern
a sequence
commands
Which reserved word lets us define a variable?
i
key
let
var
How does let differ from var?
var variables are only Strings
var variables remain constant
let variables remain constant
let variables can be reassigned
How do you increment var x by two?
x + 2
x = x + 2
x += 2
x++
What is T && F?
T
F
What is T || F?
T
F
Which if statement checks whether or not var x is greater than or equal to 10?
f x < 10 { ... }
if x >= 10 { ... }
if x > 10 { ... }
if x greater 10 { ... }
How many moveForward() statements are needed to get to the Gem?
1
2
3
4
Which lines of code need to be removed for the programme to work?
3 and 6
4 and 9
7 and 4
2 and 7
How many turnLeft() statements do I need to turn right?
1
3
5
4
What data type is a number?
Float
Double
Constant
Integer
What is a fixed value that a computer program may not alter nor change?
ConstantThis is a correct answer
Integer
Double
String
<,<=,>,>=,==,!= What are the name of these operators?
Function Operators
Comparison Operators
Print Operators
Swift Operators
What is a way to branch a code based upon Boolean value.
Else Statement
if Statement
if/else Statement
and Statement
What are different code paths that are dependent upon the answer which is the if statement?
Coding
Branching
Floating
Function Call
What can change their value over time?
Constant
Float
Integer
Variable
Text Information is also known as:
String
Constant
Bool
Int
Double Equal Sign:
Compares Values
Defines a path
Assigns a task
Provides a function
Way to modify a code path:
function
flow control
identifier
compile
Equal sign for variables stores value on the right side of the equal sign to the left side
if/else
flow control
assignment operator
return value
Mobile operating system that powers mobile devices: iPhone, iPad, and iPod touch.
source code
Xcode
IDE
iOS
_____ are ONLY used to create strings which are lines of text
compliers
parenthesis
quotations
brackets
Used for interaction with your command line program and shows results of your command line
Command
Variable
Constant
Swift single-line comments begin with
//
&&
\\
||
A code that repeats itself
Bool
Let
Loop
Var
Console area is used as a message center to show details about the way a program is running.
True
False
