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

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

(Multiple Choice)
4.8/5
(80)

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

(True/False)
4.7/5
(90)

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

(Multiple Choice)
4.8/5
(77)

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

(Multiple Choice)
4.9/5
(78)

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

(Multiple Choice)
4.8/5
(88)

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

(Multiple Choice)
4.7/5
(83)

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

(True/False)
4.8/5
(74)

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

(Multiple Choice)
4.8/5
(78)

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

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

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

(Multiple Choice)
4.9/5
(86)

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

(Multiple Choice)
4.7/5
(72)

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

(Multiple Choice)
4.8/5
(78)

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

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

(True/False)
4.8/5
(83)

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

(Multiple Choice)
4.8/5
(97)

To write information to a file, use the

(Multiple Choice)
4.8/5
(80)

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

(Multiple Choice)
4.9/5
(84)

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

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

Filters

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