Module quiz: Functions and closures :Programming Fundamentals in Swift (Meta iOS Developer Professional Certificate) Answers 2026
Question 1
Functions are special cases of closures with a name and don’t capture any values.
❌ True
✅ False
Question 2
Which of the following is the correct layout when defining a function in Swift?
❌ func function-name: return type <- (argument list)
❌ functionname (argument list) : return type
✅ func function-name (argument list) -> return type
Question 3
Which of the following is the correct layout when defining a closure in Swift?
✅ { (argument list) -> return type in code to be executed}
❌ [ (argument list) -> return type in code to be executed]
❌ ( (argument list) -> return type in code to be executed)
Question 4
Which of the following is the way in which you can call this function?
✅ hiThere(firstNamefn:”John”, secondNamesn:”Smith”)
❌ hiThere(fn:”John”, sn:”Smith”)
❌ hiThere(“John”, “Smith”)
Question 5
Closures are self-contained blocks of functionality that can be stored in a variable.
✅ True
❌ False
Question 6
A function can be identified by a combination of its name, parameter types and return types.
❌ True
✅ False
Question 7
You can pass a closure as a function parameter.
✅ True
❌ False
Question 8
You cannot use an argument label on an in-out parameter.
❌ True
✅ False
Question 9
Function parameters are immutable by default.
✅ True
❌ False
Question 10
Only one in-out parameter is allowed for each function.
❌ True
✅ False
🧾 Summary Table
| Question | Correct Answer |
|---|---|
| Q1 | False |
| Q2 | func function-name (argument list) -> return type |
| Q3 | { (argument list) -> return type in code } |
| Q4 | hiThere(firstNamefn:”John”, secondNamesn:”Smith”) |
| Q5 | True |
| Q6 | False |
| Q7 | True |
| Q8 | False |
| Q9 | True |
| Q10 | False |