Question: Assume b1 and b2 are declared Java boolean variables. Write a Java expression for each of the following Boolean statements: b1 and b2 either b1
Assume b1 and b2 are declared Java boolean variables. Write a Java expression for each of the following Boolean statements:
b1 and b2
either b1 or b2
b1 but not b2
not b1 but b2
either b1 or not b2
either not b1 or b2
neither b1 nor b2 (note this is not the same as 1f)
not b1 and not b2
either b1 or b2 but not both b1 and b2 (this is called exclusive-or)
Assume the boolean variables b1 from b2 from question 1 have been assigned values: b1 = true and b2 = false. What is the resulting (boolean) value of evaluating each of the expressions from question 1? Remember the order of operations of boolean operators: not is evaluated before and, which is evaluated before or.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
