Exam 5: Control Structures II Repetition

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

The ____________________ statement is typically used for two purposes: • To exit early from a loop. • To skip the remainder of a switch structure.

(Short Answer)
4.8/5
(31)

Suppose j, sum, and num are int variables, and the input is 26 34 61 4 -1. What is the output of the code? Suppose j, sum, and num are int variables, and the input is 26 34 61 4 -1. What is the output of the code?

(Multiple Choice)
4.7/5
(35)

In a sentinel-controlled while loop, the body of the loop continues to execute until the EOF symbol is read.

(True/False)
4.9/5
(38)

Which of the following loops does not have an entry condition?

(Multiple Choice)
4.9/5
(39)

Consider the following code. (Assume that all variables are properly declared.) This code is an example of a(n) ____ while loop. Consider the following code. (Assume that all variables are properly declared.) This code is an example of a(n) ____ while loop.

(Multiple Choice)
5.0/5
(39)

Assume all variables are properly declared. The output of the following C++ code is 2 3 4 5. Assume all variables are properly declared. The output of the following C++ code is 2 3 4 5.

(True/False)
4.8/5
(28)

To generate a random number, you can use the function rand of the header file ____________________.

(Short Answer)
4.8/5
(38)

Which of the following is a repetition structure in C++?

(Multiple Choice)
4.8/5
(41)

The number of iterations of a counter-controlled loop is known in advance.

(True/False)
4.7/5
(43)

What is the output of the following C++ code? What is the output of the following C++ code?

(Multiple Choice)
4.9/5
(34)

A loop ____________________ is a set of statements that remains true each time the loop body is executed.

(Short Answer)
4.9/5
(35)

What executes immediately after a continue statement in a while and do-while loop?

(Multiple Choice)
4.8/5
(30)

What is the value of x after the following statements execute? What is the value of x after the following statements execute?

(Multiple Choice)
4.8/5
(33)

The function eof is a member of the data type ____________________.

(Short Answer)
4.7/5
(43)

What is the next Fibonacci number in the following sequence? 1, 1, 2, 3, 5, 8, 13, 21, ...

(Multiple Choice)
5.0/5
(31)

The following while loop terminates when j > 20. The following while loop terminates when j > 20.

(True/False)
4.8/5
(30)

What is the output of the following loop? What is the output of the following loop?

(Multiple Choice)
4.8/5
(41)

The statement in the body of a while loop acts as a decision maker.

(True/False)
4.9/5
(42)

The control variable in a flag-controlled while loop is a bool variable.

(True/False)
4.9/5
(34)

Which of the following loops is guaranteed to execute at least once?

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

Filters

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