Instructor: Todd Dole
This assignment provides opportunity for you to become comfortable evaluating and constructing boolean expressions. The goal is for you to become comfortable with the syntax and semantics of boolean expressions. If after you finish this assignment you feel that you aren't totally comfortable with boolean expressions yet, then you'll want to invest some additional time to make sure you understand them.
Prelab:
boolean havingFun, amTired;
int i, j, x, y;
double a, b;
havingFun = true;
amTired = false;
i = 0;
j = 10;
x = 5;
y = -3;
a = 5.5;
b = 3.2;
Given these variable declarations and initializations, do the following:
Boolean Expressions to Evaluate:
1. amTired
2. i < 0
3. j < i || j < 100
4. i < j < 100
5. !amTired || havingFun && i > 10
6. !havingFun || j > 0 || amTired
7. !(i > 0 && !havingFun) || amTired
8. x > y && a < b
9. x + y > 0 && a - b < 2.5
10. i == j || a != b && havingFun
11. (i + j) % 2 == 0 && amTired
12. i == 0 || y < x && a > b
13. !(j == 10) || havingFun && !amTired
14. x > 0 && i >= 0 && j <= 20
15. (x - y) < 10 || (b - a) > 0
16. x * y > -20 && j / 2 == 5
17. x != 5 || j < 20 && !havingFun
18. i + x >= j && b * 2 <= a
19. !(x == 5 || y != -3) && amTired
20. i == j && a == b || havingFun && amTired