Exam 5: Loops and Files

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

The update expression of a for loop can contain more than one statement, e.g. counter++, total+= sales.

(True/False)
4.8/5
(31)

The while loop has two important parts: an expression that is tested for a true or false value, and:

(Multiple Choice)
4.8/5
(38)

string objects have a member function named c_str that returns the contents of the object formatted as a null-terminated C-string.

(True/False)
4.8/5
(41)

The condition that is tested by a while loop must be enclosed in parentheses and terminated with a semicolon.

(True/False)
4.8/5
(27)

What will the following code display? What will the following code display?

(Multiple Choice)
4.8/5
(36)

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

(Multiple Choice)
4.8/5
(30)

Assuming dataFile is a file stream object, the statement: dataFile.close();

(Multiple Choice)
4.7/5
(29)

If you place a semicolon after the test expression in a while loop, it is assumed to be a(n):

(Multiple Choice)
5.0/5
(41)

What will the following code display? What will the following code display?

(Multiple Choice)
4.9/5
(42)

In a for statement, this expression is executed only once.

(Multiple Choice)
4.9/5
(37)

A while loop is somewhat limited, because the counter can only be incremented by one each time through the loop.

(True/False)
4.8/5
(42)

What will the following code display? What will the following code display?

(Multiple Choice)
4.8/5
(44)

To allow file access in a program, you must #include this header file.

(Multiple Choice)
4.9/5
(42)

To write data to a file, you define an object of this data type.

(Multiple Choice)
4.8/5
(33)

What will the following code display? What will the following code display?

(Multiple Choice)
4.7/5
(32)

What will the following code display? What will the following code display?

(Multiple Choice)
4.8/5
(35)

This is a pre-test loop that is ideal in situations where you do not want the loop to iterate if the condition is false from the beginning.

(Multiple Choice)
4.8/5
(30)

The do-while loop is considered a(n)________ loop.

(Multiple Choice)
4.8/5
(38)

These are operators that add and subtract one from their operands.

(Multiple Choice)
4.9/5
(36)

A while loop's body can contain multiple statements, as long as they are enclosed in braces.

(True/False)
4.7/5
(33)
Showing 21 - 40 of 63
close modal

Filters

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