Exam 4: Control Statements: Part 1

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

Which of the following is not a control structure:

Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
Verified

D

Which of the following is a double-selection control statement?

Free
(Multiple Choice)
4.7/5
(49)
Correct Answer:
Verified

C

Which of the following is true?

Free
(Multiple Choice)
4.8/5
(46)
Correct Answer:
Verified

D

Which of the following is not a primitive type?

(Multiple Choice)
4.8/5
(35)

Which of the following segments is a proper way to call the method readData four times?

(Multiple Choice)
4.7/5
(29)

Which statement is false?

(Multiple Choice)
4.8/5
(30)

How many times is the body of the loop below executed? int counter = 1; While ( counter > 20 ) { // body of loop Counter = counter - 1; } // end while

(Multiple Choice)
4.8/5
(41)

Which of the following operators associates from left to right?

(Multiple Choice)
4.9/5
(32)

What is output by the following Java code segment? int temp = 180; If ( temp > 90 ) { System.out.println( "This porridge is too hot." ); // cool down Temp = temp - ( temp > 150 ? 100 : 20 ); } // end if Else { If ( temp < 70 ) { System.out.println("This porridge is too cold."); // warm up Temp = temp + (temp < 50 ? 30 : 20); } // end if } // end else If ( temp == 80 ) System.out.println( "This porridge is just right!" );

(Multiple Choice)
4.9/5
(33)

What is output by the following Java code segment? int temp = 180; While ( temp != 80 ) { If ( temp > 90 ) { System.out.print( "This porridge is too hot! " ); // cool down Temp = temp - ( temp > 150 ? 100 : 20 ); } // end if Else { If ( temp < 70 ) { System.out.print( "This porridge is too cold! "); // warm up Temp = temp + (temp < 50 ? 30 : 20); } // end if } // end else } // end while If ( temp == 80 ) System.out.println( "This porridge is just right!" );

(Multiple Choice)
4.8/5
(36)

Sentinel-controlled repetition is also known as:

(Multiple Choice)
4.8/5
(36)

The empty statement is denoted by what symbol?

(Multiple Choice)
5.0/5
(43)

Which of the following is not an algorithm?

(Multiple Choice)
4.8/5
(36)

Which of the following is the shape of an action-state symbol?

(Multiple Choice)
4.8/5
(34)

Which of the following statements about the conditional operator ( ?: )is false?

(Multiple Choice)
4.8/5
(32)

Local variables must be ________.

(Multiple Choice)
4.8/5
(30)

What is the size in bits of an int?

(Multiple Choice)
4.9/5
(30)

Counter-controlled repetition is also known as:

(Multiple Choice)
4.7/5
(43)

Which statement is false?

(Multiple Choice)
4.9/5
(35)

Which statement is true?

(Multiple Choice)
4.9/5
(35)
Showing 1 - 20 of 41
close modal

Filters

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