I don’t get what I have to do for this exercise\
- Use the precedence rules to help you evaluate the Boolean expression in the single line comment above the tricky variable.
Then, set the boolean variable tricky equal to the result (either true or false).
( 3 >= 3 && !(true || true) )
according to precedence, brackets, not, and, or, evaluates in the following order…
Since they enclose the entire expression they are moot and can be removed.
3 >= 3 && !(true || true)
means evaluating TRUE OR TRUE which we know yields,
3 >= 3 && !true
which leaves us with,
3 >= 3 && false
Owing to short-circuiting, we can immediately conclude the expression is false, regardless the truthiness of the first operand. Technically, the
>= operator does have precedence over AND so the operand would be evaluated first, yielding
true; however, this is moot.
So we have an outcome of
false Now it comes to you to set
tricky to that value and follow through with the remaining instruction.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.