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?
✗ Incorrect
42 is a whole number, so Int is the correct data type.
Which data type can hold the value 3.14159?
✗ Incorrect
Double stores decimal numbers like 3.14159.
What value can a Bool variable hold?
✗ Incorrect
Bool holds only
true or false.Which data type would you use to store the word "Hello"?
✗ Incorrect
String stores text like "Hello".
Why should you choose the right data type in Swift?
✗ Incorrect
Correct data types help the app run smoothly and prevent mistakes.
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.