Complete the code to declare an integer variable named age with value 25.
var age: [1] = 25
The Int type is used to store whole numbers without decimals in Swift.
Complete the code to declare a variable price with a decimal number type that uses less memory than Double.
var price: [1] = 19.99
Float stores decimal numbers but uses less memory than Double. It is suitable when less precision is acceptable.
Fix the error in the code by choosing the correct type for temperature that can hold decimal values.
var temperature: [1] = 36.6
Double is the default type for decimal numbers in Swift and provides high precision.
Fill both blanks to create a variable weight with a decimal type and assign it the value 70.5.
var weight: [1] = [2]
Use Double for decimal numbers and assign the value as a decimal literal.
Fill all three blanks to declare a constant pi with type Double and value 3.14159.
let [1]: [2] = [3]
Constants use let. pi is the name, Double is the type for decimals, and 3.14159 is the value.