Exam 6: Control Statements: Part 2

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

Modifying the control variable of a for statement in the body can cause errors.

(True/False)
4.8/5
(35)

The statement,when executed in a while loop,skips the remaining statements in the body of the statement and begins the next iteration of the loop.

(Multiple Choice)
4.9/5
(32)

A common logic error known as a(n)occurs when the programmer incor Rectly specifies a conditional operator,such as < instead of < =.

(Multiple Choice)
4.9/5
(33)

The first line of the for statement is sometimes called the:

(Multiple Choice)
4.9/5
(40)

A while statement automatically increments a variable that a programmer specifies.

(True/False)
4.8/5
(36)

Which of the following statements is false

(Multiple Choice)
4.7/5
(28)

Which of the following for-loop control headers results in equivalent numbers of iterations: 1)for (int q = 1;q < = 100;++q) 2)for (int q = 100;q >= 0;--q) 3)for (int q = 99;q > 0;q -= 9) 4)for (int q = 990;q > 0;q -= 90)

(Multiple Choice)
4.8/5
(26)

The initialization expression,condition and increment expression in a for statement's header must be separated with commas.

(True/False)
4.7/5
(32)

The do…while repetition statement tests the condition the body of the loop executes.

(Multiple Choice)
4.8/5
(36)

Assuming a is a bool with a value of false,which of the following eval Uates to true

(Multiple Choice)
4.9/5
(41)

Consider the code segment below. If (gender == 1) { If (age >= 65) { ++seniorFemales; } } This segment is equivalent to which of the following

(Multiple Choice)
4.8/5
(39)

The second operand of an && operator will not be evaluated if the first operand evaluates to true.

(True/False)
4.8/5
(32)

The stacking and nesting rules must be applied in a specific order.

(True/False)
4.8/5
(34)

A case with no statements is called an empty case,and requires only the break statement.

(True/False)
4.8/5
(33)

Which of the following operators ensures that at least one out of multiple conditions is true

(Multiple Choice)
4.9/5
(35)

A variable used as a counter should be initialized when it's declared.

(True/False)
4.8/5
(37)

The effects of break and continue statements can be achieved by struc tured programming techniques.

(True/False)
4.9/5
(35)

The header for (int i = 0;i < = 10;++i)will cause i to be incremented:

(Multiple Choice)
4.7/5
(33)

The rule says that any rectangle (action)in an activity diagram can be replaced by two rectangles with round edges.

(Multiple Choice)
4.9/5
(33)

Counter-controlled repetition requires only a control variable,an initial value for the control variable and an increment or decrement.

(True/False)
5.0/5
(33)
Showing 21 - 40 of 66
close modal

Filters

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