Exam 5: Looping

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

In order for a C++ program to read data from a file,

(Multiple Choice)
4.9/5
(39)

A(n) ________ is a variable that controls the number of times a loop iterates.

(Multiple Choice)
4.8/5
(27)

What will the following code print? Num = 8; Cout << --num << " "; Cout << num++ << " "; Cout << num;

(Multiple Choice)
4.7/5
(33)

What will the following code print? Num = 5; Cout << num++ << " "; Cout << num-- << " "; Cout << --num;

(Multiple Choice)
4.7/5
(38)

The statements in the body of a do-while loop are executed

(Multiple Choice)
4.9/5
(30)

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

(True/False)
4.9/5
(29)

The while loop has two important parts: a condition that is tested and a statement or block of statements that is executed

(Multiple Choice)
4.9/5
(32)

The ideal type of loop to use for repeating a menu is a(n) ________ loop.

(Multiple Choice)
5.0/5
(36)

A(n) ________ is a special value that marks the end of a list of values.

(Multiple Choice)
4.8/5
(31)

The ideal type of loop to use if you want a user to enter exactly 20 values is a(n) ________ loop.

(Multiple Choice)
4.7/5
(32)

A sentinel is a special value that

(Multiple Choice)
4.7/5
(41)

To decrement a number means to increase its value.

(True/False)
4.7/5
(39)

To ________ a value means to increase it.

(Multiple Choice)
4.8/5
(41)

If nothing within a while loop ever causes the condition to become false, a(n) ________ may occur.

(Multiple Choice)
5.0/5
(35)

For data validation, it is best to use a(n)

(Multiple Choice)
4.8/5
(35)

A variable that keeps a running total of data values is called a(n)

(Multiple Choice)
4.9/5
(33)

The ________ statement causes a loop to terminate early.

(Multiple Choice)
4.8/5
(39)

The block of code in the body of a while statement can contain an unlimited number of statements, provided they are enclosed in a set of braces.

(True/False)
4.8/5
(42)

The while loop is a(n) ________ loop, whereas the do-while loop is a(n) ________ loop.

(Multiple Choice)
4.8/5
(43)

The ++ operator

(Multiple Choice)
4.9/5
(35)
Showing 21 - 40 of 40
close modal

Filters

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