NEW
Font size
WorksheetsLec 4b - Decisions
Total questions: 10
Worksheet time: 8mins
A condition which is built up from two or more sub-conditions is called a...
Boolean operator
Compound condition
Logical operator
The operator placed between two sub-conditions is called a...
Boolean operator
Compound condition
Logical operator
What is the value of z given the following logical decision:
z = TRUE
z = FALSE
Consider the two integer variables:
i1 = 10
i2 = 5
What is the outcome of the logical condition:
!((i1 + i2) > (i2 * i1))
True
False
What is the logical equivalent of the following statement:
!(age > 10)
(age < 10)
(age <= 10)
!(age == 10)
The logical decision :
if (mGateOpen)
can also be written as:
if (mGateOpen == true)
if (mGateOpen = true)
if !(mGateOpen = false)
What does the code snippet above do?
Changes false to true
Changes true to false
All of the above
If the method above is written, what line of code is executed after the method call processNumber(x) ?
A
B
C
Given the above embedded decision in a program, what would be the output if conditionA = TRUE and conditionB = FALSE?
X
Y
Z
Given the embedded decision in the program above, what would be the output of the program if conditionA = FALSE and conditionB = TRUE?
X
Y
Z
