Exam 5: Loops and Files

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

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

(Multiple Choice)
4.8/5
(34)

To write read data from a file, you define an object of the __________ data type.

(Multiple Choice)
4.8/5
(39)

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

Something within a while loop must eventually cause the condition to become False or a(n) __________ results.

(Multiple Choice)
4.8/5
(32)

You may define a __________ in the initialization expression of a for loop.

(Multiple Choice)
4.8/5
(34)

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

(Multiple Choice)
4.8/5
(36)

What will the following code display? Int number = 6; Cout << number++ << endl;

(Multiple Choice)
4.8/5
(35)

The increment and decrement operators can be used in mathematical expressions; however, they cannot be used in relational expressions.

(True/False)
4.7/5
(33)

A loop that is inside another loop is called a(n)

(Multiple Choice)
4.7/5
(40)

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

(True/False)
4.8/5
(35)

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

(True/False)
4.8/5
(42)

What will the following code display? Int number = 6; Cout << ++number << endl;

(Multiple Choice)
4.9/5
(41)

What will the following code display? int number = 6; ++number; cout << number << endl;

(Multiple Choice)
4.7/5
(27)

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

(Multiple Choice)
4.8/5
(39)

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

(Multiple Choice)
4.8/5
(31)

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

(True/False)
4.8/5
(32)

How many times will the following loop display "Looping!"? For (int i = 20; i > 0; i--) Cout << "Looping!" << endl;

(Multiple Choice)
4.7/5
(45)

To write information to a file, use the

(Multiple Choice)
4.8/5
(32)

In the following statement, which operator is used first? While (x++ < 10)

(Multiple Choice)
4.9/5
(34)

A for statement contains three expressions: Initialization, test, and

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

Filters

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