No student devices needed. Know more
10 questions
Which of the following values would be best represented with a constant?
Player name
Player level
Player score
Player location
Which of the following would be best represented with a variable?
Name
Birthday
Age
Home address
Which keyword is used to declare a constant?
const
var
let
Which keyword is used to declare a variable?
const
var
let
What is the value of myNumber at the end of the following code?
let x = 2
let y = 4
let z = 6
let myNumber = x + y + z
4
6
10
12
What is the value of myNumber at the end of the following code?
let x = 2
let y = 4
let z = 6
let myNumber = (x + y) * z
12
24
36
42
What is the operator called when it has an arithmetic symbol in front of the equals sign?
myScore += 100
Assignment operator
Compound assignment operator
Plus equals operator
Reset operator
Fill in the blanks below to declare a variable named "test" with the initial value "Hi", then assign it the value "I love Swift!".
__ test __ "Hi“
__ = "I love Swift!".
Fill in the blanks using the options below to declare a constant named "name" and a variable called "age".
_ name = “David”
_ _ = "25"
Fill in the blanks from the options below to indicate types for the constants.
let meaningOfLife = 42 // _
let pi = 3.14159 // _
Explore all questions with a free account