Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Which of the following operators may NOT be used with operands of type boolea

ID: 3823401 • Letter: 1

Question

1) Which of the following operators may NOT be used with operands of type boolean?

2) What is a common use for a variable of type boolean?

3) What is a common name for a method that returns type boolean?

4) Which of the following data types is NOT valid for the switch expression in a switch instruction?

5) If a break statement is not included at the end of each action (alternative) in a switch instruction, what is the result?

6) Which of the following is true in Java?
I. Every else must have a preceding if.
II. Every if must have a following else.

7) What kind of loop is a data validation loop?

8) Which loop control structure can NOT be used if there are conditions under which the body of the loop should be executed zero times?

9) You know that a for loop is usually the best choice for a counting loop, but which other loop control structure(s) could possibly be used to create a counting loop?

10) Consider the following class definition:

       public class Woog{

             public static void main (String[] a){

                   Fiddle f = new Fiddle();

                   ...

             }

   }

How would you describe the relationship between Fiddle and Woog?

a)&&

Explanation / Answer

1. e ALL of the above may be used with type boolean

2. b. a flag variable

3.c. a predicate method

4.b. double

5. d.more than one action may be executed

6. a I

7.b. an indefinite loop

8.c do...while

9.c.any of the loop control structures can be used to create a counting loop

10.b.Woog is the client class. Fiddle is the supplier class.