stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
xCode 1 Flashcards | StudBud
Explore
/
xCode 1
xCode 1
20 terms
·
StudBud Administration
·
27 plays
xCode and Programming Concepts
Flashcards
20 cards
F
Practice quiz
P
Host live
L
Questions
20
Answers
1
What
type
of variable will be initialised here?
Boolean
Double
Integer
String
2
What
type
of variable will be initialised here?
String
Double
Integer
Boolean
3
Will the following code snippet compile? Why?
No, because 3 is not a Double
Yes, because 3 is a Double
Yes, as the compiler will assign the value 3.0 to number
4
Which of the following would best represented by a variable?
Home Address
Age
Name
Birthday
5
What
type
of variable will be initialised here?
Double
Boolean
String
Integer
6
What will the following code print to the console?
"Hello, playground!"
"Testing, testing, 1-2-3"
"Hello, world!"
"Goodbye, playground!"
7
Using "type inference", which if the following would be assigned a
Double
type?
var state = "Rhode Island"
let country = "Belgium"
let speedLimit = 75.0
let population = 142000
8
Which of the following values would be best represented with a constant?
Player Level
Player Name
Player Location
Player Score
9
What is the value of myNumber at the end of the following code?
12
4
6
10
10
What
type
of variable will be initialised here?
Boolean
Integer
Double
String
11
What
type
of variable will be initialised here?
Integer
Boolean
Double
String
12
Which keyword is used to declare a constant?
let
dec
const
var
13
What
type
of variable will be initialised here?
String
Double
Boolean
Integer
14
What
type
of variable will be initialised here?
Integer
String
Double
Boolean
15
Which of the following is not a reason for declaring most values as constants?
It is a best practice
Most values never change
It is safer; developers can rely on a consistent value
The compiler can make special optimisations for constants
16
Identify the issue with the code snippet
The code will not compile. x is a Double and y is an Int
There is NO problem. result will equal the product of x & y
The code will not compile. x is an Int and y is a Double
17
Which of the following is a great environment for prototyping Swift code?
Safari
Terminal
xCode
Playgrounds
18
What is the value of myNumber at the end of the following code?
24
12
36
42
19
What is the value of myNumber at the end of the following code?
36
32
18
26
20
Which keyword is used to declare a variable
let
dec
const
var