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

Which of the following statements generates a random number between 0 and 50?

(Multiple Choice)
4.9/5
(37)

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

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

(Short Answer)
4.9/5
(46)

Suppose sum, num, and j are int variables, and the input is 4 7 12 9 -1.What is the output of the following code? Suppose sum, num, and j are int variables, and the input is 4 7 12 9 -1.What is the output of the following code?

(Multiple Choice)
4.7/5
(31)

In the case of the sentinel-controlled while loop, the first item is read before the while loop is entered.

(True/False)
4.9/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.9/5
(40)

Suppose sum and num are int variables, and the input is 18 25 61 6 -1.What is the output of the following code? Suppose sum and num are int variables, and the input is 18 25 61 6 -1.What is the output of the following code?

(Multiple Choice)
4.7/5
(32)

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

(True/False)
4.7/5
(37)

A semicolon at the end of the for statement (just before the body of the loop) is a(n) ____________________ error.

(Short Answer)
4.9/5
(33)

A(n) ____-controlled while loop uses a bool variable to control the loop.

(Multiple Choice)
4.9/5
(32)

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

____ loops are called posttest loops.

(Multiple Choice)
4.9/5
(45)

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

The ____ statement can be used to eliminate the use of certain (flag) variables.

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.9/5
(39)

What is the initial statement in the following for loop? (Assume that all variables are properly declared.) What is the initial statement in the following for loop? (Assume that all variables are properly declared.)

(Multiple Choice)
4.8/5
(41)

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

(Multiple Choice)
4.8/5
(32)

When a continue statement is executed in a ____, the update statement always executes.

(Multiple Choice)
4.8/5
(37)

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

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

Filters

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