Lesson 9 - Apple Swift Coding 1

Lesson 9 - Apple Swift Coding 1

9th - 12th Grade

9 Qs

quiz-placeholder

Similar activities

Abhyudaya coding class -  Grade 7

Abhyudaya coding class - Grade 7

6th Grade - University

10 Qs

MIL March 8, 2023

MIL March 8, 2023

12th Grade

10 Qs

NHTW Programming

NHTW Programming

9th Grade

10 Qs

Access - Lesson 14

Access - Lesson 14

9th - 12th Grade

10 Qs

CSS9_Q3M3L1_QUIZ5

CSS9_Q3M3L1_QUIZ5

9th Grade

11 Qs

Wee Word Intro

Wee Word Intro

7th - 12th Grade

12 Qs

Hour of Code

Hour of Code

2nd - 12th Grade

10 Qs

Desarrollo de Aplicaciones Web - Día 3

Desarrollo de Aplicaciones Web - Día 3

10th Grade

10 Qs

Lesson 9 - Apple Swift Coding 1

Lesson 9 - Apple Swift Coding 1

Assessment

Quiz

Computers

9th - 12th Grade

Easy

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type is foo in the code below? let foo = "Hello"

Let

String

"Hello"

Hello

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type is foo in the code below? let foo = 42

Double

foo

42

Int

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type is foo in the code below? let foo: Double = 42

Double

foo

42

Int

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type is foo in the code below? var foo: SolarPhenomen

SolarPhenomenon

Interstellar

variable

Not possible to tell

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is one way Swift determines the type of a value in your code?

Type intrusion

Type allegiance

Type writing

Type inference

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does Swift decide what type distance should be? let distance: Double = 4

Type inference

Type annotation

Typewriting

Type interference

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which line shows correct type annotation in Swift?

String: let name

let String: name

let name: String

let String

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If you're reading code and aren't sure of the type of a variable or constant, what's the quickest way to find out?

Remember that variables are always strings and constants are always numbers.

Option-click the constant's or variable's name in x-code

Rewrite the section of code using different encapsulations

Assign different value types to the variables and check for errors

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you change the type of a Constant or Variable after it's declared?

Create the Value as a Var Variable

Don't give the value a type

You can't change the value of a value

Assign a new value of a different type