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