Complete the code to declare a variable with an explicit type annotation.
var age: [1] = 25
String instead of Int for numbers.The variable age is declared with the explicit type Int to hold integer values.
Complete the code to declare a constant with an explicit type annotation.
let pi: [1] = 3.14159
Int for decimal numbers causes errors.String instead of a numeric type.The constant pi is declared as a Double because it holds a decimal number.
Fix the error in the code by adding the correct explicit type annotation.
var isActive: [1] = trueInt or String for boolean values.The variable isActive holds a true/false value, so it must be of type Bool.
Fill both blanks to declare a variable with explicit type annotation and assign a string value.
var name: [1] = [2]
Int as the type for text.The variable name is declared as a String and assigned the string value "John".
Fill all three blanks to declare a constant with explicit type annotation and assign a boolean value.
let isEnabled: [1] = [2] // [3]
Int as the type for boolean values.The constant isEnabled is declared as a Bool and assigned the boolean value true. The comment explains the declaration.