Section 8.15 Do the following

(De Morgan’s Laws) In this chapter, we have discussed the logical operators &&, || and !. De Morgan’s Laws can sometimes make it more convenient for us to express a logical expression. These laws state that the expression !(condition1 && condition2) is logically equivalent to the expression (!condition1 || !condition2). Also, the expression !(condition1 || condition2) is logically equivalent to the expression (!condition1 && !condition2). Use De Morgan’s Laws to write equivalent expressions for each of the following, then write a program to show that the original expression and the new expression are equivalent in each case:

1. !( x < 5 ) && !( y <= 7 )
Answer: !(( x < 5 ) || ( y <= 7 ))

2. !( a == b ) || !( g != 5 )
Answer: !(( a == b ) && ( g != 5 ))

3. !( ( x <= 8 ) && ( y < 4 ) )
Answer: ( !( x <= 8 ) || !( y < 4 ) )

4. !( ( i < 4 ) || ( j <= 6 ) )
Answer: ( !( i < 4 ) && !( j <= 6 ) )