
Apple Swift Development II - Unit 3 - Vocats Test
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Used 8+ times
FREE Resource
22 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If a variable can be set to any given structure, what is the variable’s type?
Any
as
anyObject
is
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When is it appropriate to use the as! Operator?
When you need to convert a value to an Any type
When you need to downcast from one type to another, on the condition that the type is valid
When you need to downcast from one type to another and you can guarantee the type is valid
When you need to unwrap an optional
3.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
When you conditionally downcast from one type to another and store the value in a constant, which combination of keywords is used? Select all that apply.
as!
as?
if let
is
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following block of code?
let sum = 99
func computSum(scores: [Int]) -> Int {
var sum = 0
for score in scores {
sum += score
}
return sum
}
computeSum(scores: [70, 30, 9])
0
00
109
Compiler error; sum cannot be defined twice in the same scope
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following block of code?
let sum = 99
func computeSum(scores: [Int]) -> Int {
var sum = 0
for score in scores {
sum += score
}
return sum
}
let sum = computeSum(scores: [70, 30, 9])
0
99
109
Compiler error; sum cannot be defined twice in the same scope
6.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Why is self in front of the property names of the initializer? Check all that apply.
struct ThemePark {
var name: String
var numEmployees: Int
var mostPopularRide: String
init(name: String, numEmployees: Int, mostPopularRide:
String) {
self.name = name
self.numEmployees = numEmployees
self.mostPopularRide = mostPopularRide
}
}
It helps the reader distinguish between the parameters and properties with the same name
self is always required when setting properties with an initializer
It helps Swift compiler distinguish between the parameters and properties with the same name.
self is not required
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What property would you modify if you wanted to add a badge to a tab?
badge
badgelcon
badgeString
badgeValue
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Programming Quiz 4
Quiz
•
9th - 10th Grade
20 questions
AIB_2Q
Quiz
•
12th Grade
18 questions
js basics
Quiz
•
4th Grade - University
20 questions
Arrays in Java
Quiz
•
9th - 12th Grade
27 questions
Programming Unit 1 Review of Unit 3
Quiz
•
12th Grade
20 questions
Python Quiz (part 1)
Quiz
•
9th - 12th Grade
20 questions
Review JavaScript
Quiz
•
11th Grade - University
19 questions
EX SWIFT 4TO SEMESTRE
Quiz
•
11th Grade
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz
Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH
Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms
Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines
Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
11 questions
All about me
Quiz
•
Professional Development
15 questions
Subtracting Integers
Quiz
•
7th Grade
