Exam 5: Control Statements: Part 2

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Suppose variable gender is MALE and age equals 60,how is the expression ( gender == FEMALE )&& ( age >= 65 ) Evaluated?

(Multiple Choice)
4.8/5
(36)

Which expression is equivalent to if ( ! ( grade == sentinelValue ))?

(Multiple Choice)
4.9/5
(40)

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" ); } // end switch Which of the following values for q will result in kiwi being included in the output?

(Multiple Choice)
4.8/5
(28)

The control variable of a counter-controlled loop should be declared as ________to prevent errors.

(Multiple Choice)
4.9/5
(32)

Which of the following will not help prevent infinite loops?

(Multiple Choice)
4.8/5
(26)
Showing 21 - 25 of 25
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)