Ch 3 Questions #3

 

Boolean Expressions

 

 

 

 

1.         How many logical operators are there and what are they?

 

2.         What is the difference between equality operators and relational operators?

 

7.         Given the following:

 

            if ( (x = 10) && (x != 5)

          System.out.println ("Go home");

     else

          System.out.println ("Stay here");

 

            What is wrong with the above code?

 

4.         Construct a truth table for x, y, and z where x = false and y = true and z = true.

 

5.         How should floating point values be compared?

 

6.         What are the increment and decrement operators?