Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

App Development with Swift Quiz 2

Total questions: 34

Worksheet time: 9hrs 30mins

Name
Class
Date
1.



(a)  

2.



(a)  

3.



(a)  

4.



(a)  

5.

Keyboard short to build the project

a)

Command - B

b)

Command - R

c)

Command - .

d)

Command - S

6.

Keyboard short to run the project

a)

Command - B

b)

Command - R

c)

Command - .

d)

Command - S

7.

Keyboard short to stop the project

a)

Command - B

b)

Command - R

c)

Command - .

d)

Command - S

8.

This is a raw representation of a String value.

a)

String

b)

Constant

c)

Variable

d)

String Literal

9.

TRUE OR FALSE: String Interpolation is a way of combining two strings with the + operator.

a)

TRUE

b)

FALSE

10.

What is the result of this program?

a)

false

true

false

b)

false

false

true

c)

true

false

true

d)

true

true

false

11.

What will be the result?

(a)  

12.

________ is made up of a name, a set of inputs, and a set of output but both input and outputs are optional.

a)

Variable

b)

Function

c)

String

d)

Operator

13.

3 Reasons to use Class over Structure

a)
  • When you’re working with a framework that uses classes.

b)

When you want to list a constant or variable declarations with appropriate type annotation. 

c)
  • When you want to refer to the same instance of a type in multiple places.

d)
  • When you want to model inheritance.

14.

An Array syntax to check if a certain value exists in an array.

a)

.contains

b)

.isEmpty

c)

.count

d)

.append

15.

An Array syntax to add a new element at the end of the array

a)

.contains

b)

.isEmpty

c)

.insert

d)

.append

16.

An Array syntax to add a new element at the specific index of array.

a)

.contains

b)

.isEmpty

c)

.insert

d)

.append

17.

3 Main types of navigation hierarchy.

(a)  

18.

To compare two strings, how would you check for equality?

a)

With the operator ==

b)

With String Literal

c)

With an index

d)

With lowercased( ) method

19.

Given the following code, what is the resulting value of mathExpression?

a)

5

b)

"Solve for x.20 = 5x + 3"

c)

"Solve for x.20 = 3x + 5"

d)

"Solve for 5.20 = 55 + 5"

20.

Why does the following expression return false?

"Jonathan" == "jonathan"

a)

It doesn't. The expression returns true.

b)

An uppercase character and a lowercase character aren't the same thing.

c)

Because == is the wrong operator for string equality.

21.

A function can be called using the code below. How was the function most likely declared?

let value = multiply (5, by: 4)

a)

func multiply (_ first: Int, by: Int)

b)

func multiply (first: Int, by: Int) -> int

c)

func multiply (_ first: Int, by: Int) -> int

d)

func multiply (first: Int, by: Double) -> int

22.

Choose TWO: Which of the following statements are true about these classes?

a)

Scientist is a base class

b)

There is only one subclass of Scientist

c)

Geologist, Physicist, and Astrophysicist are all descendants of Scientist

d)

Astrophysicist does not inherit from Scientist.

23.

Why does the following code does not compile?

a)

Scientist does not have the necessary initializer.

b)

The performCalculation function in Physicist does not call the parent implementation using super.

c)

The performCalculation function in Scientist is missing the override keyword.

d)

The performCalculation function in Physicist is missing the override keyword.

24.

Choose TWO: Which of the following statements are true about this code?

a)

There are four instances of Calculator.

b)

calc1 and calc2 have the same number of buttons because they reference the same calculator

c)

calc3 and calc4 have the same number of buttons because they reference the same calculator

d)

calc1 has 25 buttons and calc2 has 16.

25.

Given the following array, how would you insert "56123" before "29371"

var bankAccounts = [18203, 29371, 10295, 47290]

a)

bankAccounts.insert (56123, at: 1)

b)

bankAccounts.append (56123)

c)

bankAccounts.insert (56123, at: 2)

d)

bankAccounts [1] = 56123

26.

Which of the following allows you to execute code for a specific control event?

a)

@IBAction

b)

@IBOutlet

27.

Which of the following allows you to access properties on a specific view or control?

a)

@IBAction

b)

@IBOutlet

28.

Choose THREE: Which of the following Interface Builder tools can you use to create constraints?

a)

Auto Layout

b)

Add New Constraints tool

c)

Align tool

d)

Update Frames

29.

This is the system image of the tab bar item for MORE.

a)

b)

c)

d)

e)

30.

This is the system image of the tab bar item for CONTACTS.

a)

b)

c)

d)

e)

31.

This is the system image of the tab bar item for SEARCH.

a)

b)

c)

d)

e)

32.

This is the system image of the tab bar item for MOST RECENT.

a)

b)

c)

d)

e)

33.

This is the system image of the tab bar item for FAVORITES.

a)

b)

c)

d)

e)

34.

Which navigation style does the Settings app use?

a)

Hierarchical

b)

Flat

c)

Content-driven