Boolean Expressions Specific expressions can be evaluated using truth tables 1.
ID: 3759248 • Letter: B
Question
Boolean Expressions
Specific expressions can be evaluated using truth tables
1.
if (total < MAX+5 && !found)
System.out.println ("Processing…");
total < MAX
found
!found
total < MAX && !found
2.
if (!done && (count > MAX))
System.out.println (“Completed.");
3. Assuming done is a boolean variable and value is an int variable create a truth table for:
(value > 0) || !done
4. Assuming c1 and c2 are boolean variables, create a truth table for the expression:
(c1 && !c2) || (!c1 && c2)
total < MAX
found
!found
total < MAX && !found
Explanation / Answer
1)
truth table for first will be:
2)
truth table will be
3)
truth table will be
4)
truth table will be
total<max found !found total<max&& !found 0 0 1 0 0 1 0 0 1 0 1 1 1 1 0 0Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.