Exam 5: Loops and Files

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

The __________ loop is a good choice when you do not want the loop to iterate if the condition is False in the beginning.

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

A

A file must be __________ before data can be written to or read from it.

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

A

When the increment operator precedes its operand, as ++num, the expression is in __________ mode.

Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
Verified

B

What will the following code display? Int number = 6; Int x = 0; X = number--; Cout << x << endl;

(Multiple Choice)
4.9/5
(32)

What will the following code display? Int x = 0; While (x < 5) { Cout << x << " "; X++; }

(Multiple Choice)
4.8/5
(46)

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

The __________ loop is ideal in situations where you want the loop to iterate at least once.

(Multiple Choice)
4.7/5
(32)

A file __________ is a small holding section of memory that file-bound information is first written to.

(Multiple Choice)
4.8/5
(44)

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

(True/False)
4.8/5
(35)

An output file is a file that data is written to.

(True/False)
4.8/5
(36)

The while loop is a __________ loop.

(Multiple Choice)
4.8/5
(25)

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

(Multiple Choice)
4.9/5
(29)

Multiple relational expressions cannot be placed into the test condition of a for loop.

(True/False)
4.8/5
(35)

How many times will the following loop display "Hello world!"? For (int i = 0; i < 20; i++) Cout << "Hello world!" << endl;

(Multiple Choice)
4.7/5
(39)

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

(True/False)
4.9/5
(34)

This operator increments the value of its operand and then uses the value in context.

(Multiple Choice)
4.8/5
(29)

What will the following code display? Int number = 6; Int x = 0; X = --number; Cout << x << endl;

(Multiple Choice)
4.9/5
(31)

You may not use both break and continue statements within the same set of nested loops.

(True/False)
4.8/5
(38)

The update expression of a for loop can contain more than one statement, for example: for(i = 5; i <= 10; i++, total+= sales)

(True/False)
4.7/5
(44)

The do-while loop is considered

(Multiple Choice)
4.8/5
(38)
Showing 1 - 20 of 60
close modal

Filters

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