WorksheetsApp Development with Swift Quiz 2
Total questions: 34
Worksheet time: 9hrs 30mins
(a)
(a)
(a)
(a)
Keyboard short to build the project
Command - B
Command - R
Command - .
Command - S
Keyboard short to run the project
Command - B
Command - R
Command - .
Command - S
Keyboard short to stop the project
Command - B
Command - R
Command - .
Command - S
This is a raw representation of a String value.
String
Constant
Variable
String Literal
TRUE OR FALSE: String Interpolation is a way of combining two strings with the + operator.
TRUE
FALSE
What is the result of this program?
false
true
false
false
false
true
true
false
true
true
true
false
What will be the result?
(a)
________ is made up of a name, a set of inputs, and a set of output but both input and outputs are optional.
Variable
Function
String
Operator
3 Reasons to use Class over Structure
When you’re working with a framework that uses classes.
When you want to list a constant or variable declarations with appropriate type annotation.
When you want to refer to the same instance of a type in multiple places.
When you want to model inheritance.
An Array syntax to check if a certain value exists in an array.
.contains
.isEmpty
.count
.append
An Array syntax to add a new element at the end of the array
.contains
.isEmpty
.insert
.append
An Array syntax to add a new element at the specific index of array.
.contains
.isEmpty
.insert
.append
3 Main types of navigation hierarchy.
(a)
To compare two strings, how would you check for equality?
With the operator ==
With String Literal
With an index
With lowercased( ) method
Given the following code, what is the resulting value of mathExpression?
5
"Solve for x.20 = 5x + 3"
"Solve for x.20 = 3x + 5"
"Solve for 5.20 = 55 + 5"
Why does the following expression return false?
"Jonathan" == "jonathan"
It doesn't. The expression returns true.
An uppercase character and a lowercase character aren't the same thing.
Because == is the wrong operator for string equality.
A function can be called using the code below. How was the function most likely declared?
let value = multiply (5, by: 4)
func multiply (_ first: Int, by: Int)
func multiply (first: Int, by: Int) -> int
func multiply (_ first: Int, by: Int) -> int
func multiply (first: Int, by: Double) -> int
Choose TWO: Which of the following statements are true about these classes?
Scientist is a base class
There is only one subclass of Scientist
Geologist, Physicist, and Astrophysicist are all descendants of Scientist
Astrophysicist does not inherit from Scientist.
Why does the following code does not compile?
Scientist does not have the necessary initializer.
The performCalculation function in Physicist does not call the parent implementation using super.
The performCalculation function in Scientist is missing the override keyword.
The performCalculation function in Physicist is missing the override keyword.
Choose TWO: Which of the following statements are true about this code?
There are four instances of Calculator.
calc1 and calc2 have the same number of buttons because they reference the same calculator
calc3 and calc4 have the same number of buttons because they reference the same calculator
calc1 has 25 buttons and calc2 has 16.
Given the following array, how would you insert "56123" before "29371"
var bankAccounts = [18203, 29371, 10295, 47290]
bankAccounts.insert (56123, at: 1)
bankAccounts.append (56123)
bankAccounts.insert (56123, at: 2)
bankAccounts [1] = 56123
Which of the following allows you to execute code for a specific control event?
@IBAction
@IBOutlet
Which of the following allows you to access properties on a specific view or control?
@IBAction
@IBOutlet
Choose THREE: Which of the following Interface Builder tools can you use to create constraints?
Auto Layout
Add New Constraints tool
Align tool
Update Frames
This is the system image of the tab bar item for MORE.
This is the system image of the tab bar item for CONTACTS.
This is the system image of the tab bar item for SEARCH.
This is the system image of the tab bar item for MOST RECENT.
This is the system image of the tab bar item for FAVORITES.
Which navigation style does the Settings app use?
Hierarchical
Flat
Content-driven
