Exam 4: Control Statements: Assignment, and Operators

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

Where can local variables declared within a method's body be used?

Free
(Multiple Choice)
4.9/5
(35)
Correct Answer:
Verified

A

Which statement is true?

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

D

Which of the following statements is true?

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

C

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); } Else { If (temp < 70) { System.out.println("This porridge is too cold."); // warm up Temp = temp + (temp < 50 ? 30 : 20); } } If (temp == 80) { System.out.println("This porridge is just right!"); }

(Multiple Choice)
4.7/5
(40)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(32)

What does the expression x %= 10 do?

(Multiple Choice)
4.9/5
(30)

What is the result value of c at the end of the following code segment? int c = 8; C++; ++c; C %= 5;

(Multiple Choice)
4.7/5
(36)

Which statement is false?

(Multiple Choice)
4.8/5
(32)

A decision symbol in an activity diagram takes the shape of a ________.

(Multiple Choice)
4.9/5
(40)

Counter-controlled iteration is also known as:

(Multiple Choice)
4.8/5
(33)

Which of the following operators associates from left to right?

(Multiple Choice)
4.7/5
(40)

What is output by the following Java code segment? int temp = 200; If (temp > 90) { System.out.println("This porridge is too hot."); } If (temp < 70) { System.out.println("This porridge is too cold."); } If (temp == 80) { System.out.println("This porridge is just right!"); }

(Multiple Choice)
4.7/5
(31)

Which of the following terms is not used to refer to a sentinel value that breaks out of a while loop?

(Multiple Choice)
4.8/5
(31)

Which of the following code segments does not increment val by 3:

(Multiple Choice)
4.9/5
(33)

Which primitive type can hold the largest value?

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(35)

In an activity diagram, the merge symbol has the same shape as what other symbol?

(Multiple Choice)
4.8/5
(27)

Which of the following is not an error (either a syntax error or a logic error)?

(Multiple Choice)
4.9/5
(39)

Which of the following is not represented graphically in activity diagrams for control structures?

(Multiple Choice)
4.9/5
(30)

Which of the following is not a control structure:

(Multiple Choice)
4.8/5
(33)
Showing 1 - 20 of 39
close modal

Filters

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