WorksheetsBoolean Expression and Function
Total questions: 4
Worksheet time: 2mins
Name
Class
Date
1.
What does this evaluate to?
true || false
a)
true
b)
false
2.
What does this evaluate to?
(9 * 3) - 5 < 50 / 2 && 4 * 3 == 20 - 5
a)
true
b)
false
3.
func findProductOf(num1: Int, num2: Int) -> Int {
return num1 * num2
}
All of the following would be an appropriate way to call this function EXCEPT
a)
let product = findProductOf(num1: 3, num2: 5)
b)
anotherFunctionCall(num: findProductOf(num1: 5, num2: 3))
c)
var product = findProductOf(num1: 3, num2: 5)
d)
findProductOf(num1: 5, num2: 3)
4.
let firstCondition = true
let secondCondition = false
firstCondition == !secondCondition
a)
true
b)
false
100 %
