Multiple Choice
For the code segment below:
Switch(q)
{
Case 1:
System.out.println("apple") ;
Break;
Case 2:
System.out.println("orange") ;
Break;
Case 3:
System.out.println("banana") ;
Break;
Case 4:
System.out.println("pear") ;
Case 5:
System.out.println("grapes") ;
Default:
System.out.println("kiwi") ;
}
Which of the following values for q will result in kiwi being included in the output?
A) 2.
B) Any integer less than 1 and greater than or equal to 4.
C) 1.
D) 3.
Correct Answer:

Verified
Correct Answer:
Verified
Q3: Consider the following two Java code segments:
Q5: Suppose variable gender contains MALE and age
Q6: Which statement prints the floating-point value 123.456
Q14: Which formatting flag indicates that the floating-point
Q15: Which of the following statements is true?<br>A)
Q17: Which expression is equivalent to if (!(grade
Q24: For the two code segments below:<br>Segment A<br>Int
Q25: Boolean values can be displayed as the
Q26: Consider the code segment below.<br>If (gender ==
Q27: Counter-controlled repetition requires<br>A)A control variable and initial