0
0
iOS Swiftmobile~5 mins

Data types (Int, Double, String, Bool) in iOS Swift - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an Int in Swift?
An Int is a data type that stores whole numbers without decimals, like 5 or -10.
Click to reveal answer
beginner
How does Double differ from Int?
Double stores numbers with decimals, like 3.14, while Int stores whole numbers only.
Click to reveal answer
beginner
What kind of values does Bool hold?
Bool holds only two values: true or false. It is used for yes/no or on/off decisions.
Click to reveal answer
beginner
What is a String in Swift?
String is a data type that stores text, like words or sentences, for example: "Hello" or "Swift".
Click to reveal answer
intermediate
Why is it important to use the correct data type in Swift?
Using the correct data type helps the app use memory efficiently and prevents errors by making sure data is handled properly.
Click to reveal answer
Which Swift data type would you use to store the number 42?
ABool
BInt
CString
DDouble
Which data type can hold the value 3.14159?
ADouble
BInt
CBool
DString
What value can a Bool variable hold?
AAny number
BText only
Ctrue or false
DDecimal numbers
Which data type would you use to store the word "Hello"?
AString
BBool
CInt
DDouble
Why should you choose the right data type in Swift?
ATo make the app slower
BIt does not matter
CTo confuse other developers
DTo use memory efficiently and avoid errors
Explain the difference between Int and Double in Swift.
Think about numbers with and without decimals.
You got /3 concepts.
    Describe when you would use a Bool and a String in an app.
    Consider yes/no questions and words.
    You got /3 concepts.