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
(74)

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

(Multiple Choice)
4.9/5
(88)

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.9/5
(84)

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

(True/False)
4.8/5
(68)

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

(Multiple Choice)
4.7/5
(74)

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

(Multiple Choice)
4.8/5
(67)

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

(Multiple Choice)
4.7/5
(72)

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
(87)

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

(Multiple Choice)
4.9/5
(93)

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

(Multiple Choice)
4.9/5
(83)

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
(95)

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

(Multiple Choice)
4.8/5
(79)

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

(Multiple Choice)
4.9/5
(79)

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

(Multiple Choice)
4.8/5
(78)

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

(Multiple Choice)
4.7/5
(80)

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

(Multiple Choice)
4.8/5
(73)

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
(65)

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

(Multiple Choice)
4.8/5
(84)

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

(Multiple Choice)
4.9/5
(83)

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

(True/False)
4.8/5
(75)
Showing 21 - 40 of 63
close modal

Filters

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