Fill in the truth table for the following boolean expression:
a | b | !a || b && (a || !b) |
---|---|---|
T | T | |
T | F | |
F | T | |
F | F |
Given the following truth table:
a | b | expression |
---|---|---|
T | T | F |
T | F | T |
F | T | T |
F | F | F |
Using only boolean operators (&& || !), write a boolean expression that has the truth table above.
If we lift the restriction of only using boolean operators, is there a simpler expression that has the truth table above? If so, give it.
Complete the (instance) isEmpty method below so that it determines if the mug is empty.
public boolean isEmpty() { }
Complete the (instance) containsLiquid method below so that it determines if the mug contains the given liquid.
public boolean containsLiquid(String liquid) { }
Complete the hasThirdLetter method below so that it determines if the given string has the given character as its third letter.
public static boolean hasThirdLetter(String str, char ch) { }