wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Swift Y9 Summative Assessment Term 2

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

What is Swift Playground?

a)

A tool used to write a pseudo code for any program

b)

Advanced tool to create applications

c)

Powerful programming language created by Apple

d)

An algorithmic designer tools

2.

What is a sequence ?

a)

specific actions for the computer to perform

b)

Is the order in which the commands are given

c)

is the repeated actions

d)

is the algorithmic thinking skills

3.

What is coding?

a)

The repeated actions in the program

b)

Algorithmic thinking skills

c)

Telling a ​computer what to do

d)

None of the above

4.

What are bugs?

a)

application interface

b)

errors while coding

c)

fixing the errors

d)

the order of actions

5.

A list of steps that you can follow to finish a task

a)

To do list

b)

schedule

c)

algorithm

d)

directions

6.

longer codes can involve ----------------

a)

less bugs

b)

more bugs

c)

fewer variables

d)

fewer actions

7.

With the following code, what would you expect to see happen when you run your code?


func saySomething ( ) {

print ("Functions are awesome")

saySomething ( )

}

saySomething ( )

a)

Functions are awesome, once

b)

Functions are awesome, twice

c)

Functions are awesome, repeated over and over and over...

d)

Nothing

8.

For loops can be useful for

a)

fastening a handle made of rope

b)

encircling an object

c)

running a block of code over and over for a set number of times

d)

keeping a privileged group informed

9.

The IDE used in Swift is:

a)

Swiftc

b)

Gas

c)

Xcode

d)

Ld

10.

To create Contants in Swift we use keyword ...

a)

Conts

b)

Contants

c)

Let

d)

None Of Above

11.

Commands have no spaces between words and always end with:

a)

colon

b)

spaces

c)

parentheses

d)

semicolons

12.

What is conditional code?

a)

A command block

b)

A command which will only run of it is true

c)

A command which will only run if it is false

13.

What is a Boolean?

a)

A value that can only be false

b)

A value which can only be true

c)

A value that can only be true or false

14.

Which of the following is NOT a logical operator

a)

AND

b)

NOT

c)

IF

d)

OR

15.

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

a)

I only

b)

II only

c)

III only

d)

I, II and III

16.

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?

a)

new total ==10

b)

variable total =10

c)

var total =10

d)

let total =10

17.

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

}

a)

You are promoted

b)

You are promoted to grade 10

c)

You are promoted to grade 10

You are promoted

d)

no result

18.

Which of the following logical operator means "Equals"?

a)

=

b)

!=

c)

==

d)

>=

19.
a)

Good morning

b)

Good afternoon

c)

Good evening

20.

What code is missing?

a)

collectGem()

b)

toggleSwitch()

c)

turnRight()

d)

moveForward()This is a correct answer

21.

How many times should this FOR loop repeat?

a)

2

b)

5

c)

1

d)

none

22.

What type of variable will be initialised here?

a)

Boolean

b)

Integer

c)

String

d)

Double

23.

What type of variable

a)

Boolean

b)

Integer

c)

String

d)

Double

24.

IF statement is

a)

a code structure used to run code based on the value

b)

is a collection of functions

c)

is a pattern

d)

none of them

25.

Else if is

a)

used to check a condition that isn't check by the if block

b)

A pattern

c)

a sequence

d)

commands

26.

Which reserved word lets us define a variable?

a)

i

b)

key

c)

let

d)

var

27.

How does let differ from var?

a)

var variables are only Strings

b)

var variables remain constant

c)

let variables remain constant

d)

let variables can be reassigned

28.

How do you increment var x by two?

a)

x + 2

b)

x = x + 2

c)

x += 2

d)

x++

29.

What is T && F?

a)

T

b)

F

30.

What is T || F?

a)

T

b)

F

31.

Which if statement checks whether or not var x is greater than or equal to 10?

a)

f x < 10 { ... }

b)

if x >= 10 { ... }

c)

if x > 10 { ... }

d)

if x greater 10 { ... }

32.

How many moveForward() statements are needed to get to the Gem?

a)

1

b)

2

c)

3

d)

4

33.

Which lines of code need to be removed for the programme to work?

a)

3 and 6

b)

4 and 9

c)

7 and 4

d)

2 and 7

34.

How many turnLeft() statements do I need to turn right?

a)

1

b)

3

c)

5

d)

4

35.

What data type is a number?

a)

Float

b)

Double

c)

Constant

d)

Integer

36.

What is a fixed value that a computer program may not alter nor change?

a)

ConstantThis is a correct answer

b)

Integer

c)

Double

d)

String

37.

<,<=,>,>=,==,!= What are the name of these operators?

a)

Function Operators

b)

Comparison Operators

c)

Print Operators

d)

Swift Operators

38.

What is a way to branch a code based upon Boolean value.

a)

Else Statement

b)

if Statement

c)

if/else Statement

d)

and Statement

39.

What are different code paths that are dependent upon the answer which is the if statement?

a)

Coding

b)

Branching

c)

Floating

d)

Function Call

40.

What can change their value over time?

a)

Constant

b)

Float

c)

Integer

d)

Variable

41.

Text Information is also known as:

a)

String

b)

Constant

c)

Bool

d)

Int

42.

Double Equal Sign:

a)

Compares Values

b)

Defines a path

c)

Assigns a task

d)

Provides a function

43.

Way to modify a code path:

a)

function

b)

flow control

c)

identifier

d)

compile

44.

Equal sign for variables stores value on the right side of the equal sign to the left side

a)

if/else

b)

flow control

c)

assignment operator

d)

return value

45.

Mobile operating system that powers mobile devices: iPhone, iPad, and iPod touch.

a)

source code

b)

Xcode

c)

IDE

d)

iOS

46.

_____ are ONLY used to create strings which are lines of text

a)

compliers

b)

parenthesis

c)

quotations

d)

brackets

47.

Used for interaction with your command line program and shows results of your command line

a)

Command

b)

Variable

c)

Print

d)

Constant

48.

Swift single-line comments begin with

a)

//

b)

&&

c)

\\

d)

||

49.

A code that repeats itself

a)

Bool

b)

Let

c)

Loop

d)

Var

50.

Console area is used as a message center to show details about the way a program is running.

a)

True

b)

False