Exam 5: Loops and Files

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

An initialization expression may be omitted from the for loop if no initialization is required.

(True/False)
4.8/5
(78)

The do-while loop is a(n)________ loop that is ideal in situations where you always want the loop to iterate at least once.

(Multiple Choice)
4.8/5
(96)

How many times will the following loop display "Hello"? How many times will the following loop display Hello?

(Multiple Choice)
5.0/5
(75)

If you want a user to enter exactly 20 values, which loop would be the best to use?

(Multiple Choice)
4.9/5
(90)

In C++ 11 you can pass a string object as argument to a file stream object's open member function.

(True/False)
4.9/5
(91)

The statements in the body of a while loop may never be executed, whereas the statements in the body of a do-while loop will be executed:

(Multiple Choice)
5.0/5
(71)

This is a special value that marks the end of a list of values.

(Multiple Choice)
4.9/5
(83)

Something within a while loop must eventually cause the condition to become false, or a(n)________ results.

(Multiple Choice)
5.0/5
(77)

You may not use the break statement in a nested loop.

(True/False)
4.7/5
(63)

This is a control structure that causes a statement or group of statements to repeat.

(Multiple Choice)
4.9/5
(75)

This is a variable that is regularly incremented or decremented each time a loop iterates.

(Multiple Choice)
4.9/5
(82)

The while loop contains an expression that is tested for a true or false value, and a statement or block that is repeated as long as the expression:

(Multiple Choice)
4.9/5
(75)

This statement may be used to stop a loop's current iteration and begin the next one.

(Multiple Choice)
4.8/5
(82)

You may nest while and do-while loops, but you may not nest for loops.

(True/False)
4.8/5
(67)

It is possible to define a file stream object and open a file in one statement.

(True/False)
4.9/5
(90)

The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop.

(True/False)
4.9/5
(76)

The while loop is this type of loop.

(Multiple Choice)
4.9/5
(73)

This means to increase a value by one.

(Multiple Choice)
4.8/5
(90)

How many times will the following loop display "Hello"? How many times will the following loop display Hello?

(Multiple Choice)
4.8/5
(84)

When the increment operator precedes its operand, as in ++num1, the expression is in this mode.

(Multiple Choice)
4.9/5
(95)
Showing 41 - 60 of 63
close modal

Filters

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