For the questions below, assume that p, q, and r are boolean expressions
with the values true, true, and false, respectively.
Find the value of each boolean expression.
p && !q
p && q || !r
p && ! (q || r)
!p && q
p || q && r
PART II
RELATIONAL OPERATORS :
< , >, <= , >= , == , !=
Assume the following variables have been declared:
int m = -5;
int n = 8 ;
char c = 'a';
double x = -3.56;
double y = 0.0;
double z = 44.7;
For the questions below, find the value of the boolean expressions.
m <= n
-2 * m <= 8
(x <= y) && (y <= z)
! (x < y)
! ((m <= n) && (x + z > y))
!( m <= n) || ! ( x + z > y)
! (( m > n) && !(x < z))
0 <= m <= 10
c == 97
0 <= m && m <= 10
PART III
Write a boolean expression to express that x is nonzero.
Write a boolean expression to express that x is strictly between -10 and 10.
Write a boolean expression to express that both x and y are positive orboth x and y are negative.
Write a boolean expression to express that c is strictly uppercase.
Write a boolean expression to express that c is a vowel.