Variables Flashcards
1
Q
How do you declare a Variable?
A
With the var-Keyword
2
Q
If you are clear about the kind of values the constant or variable can store, how do you provide a type annotation when you declare a variable?
A
Write a type annotation by placing a colon after the constant or variable name, followed by a space, followed by the name of the type to use.
3
Q
What represents whole Numbers and what is the keyword?
A
Integer - Int
4
Q
Which two Types represent floating-Numbers in Swift?
What is their keyword and Difference?
A
- Double - Double - Represents a 64-bit floating-point number.
- Float - Float - Represents a 32-bit floating-point number.
5
Q
How do you convert variables in different Types?
A
6
Q
How do you concatenate a string with an variable?
A
” string…. (nameOfVaribale)”