Exam 5: Looping

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

A(n) ____________________ is a structure that allows repeated execution of a block of statements.

Free
(Short Answer)
4.8/5
(35)
Correct Answer:
Verified

loop

Match each item with a statement below:
A loop that never ends
garbage
The value of an uninitialized variable
outer loop
Another name for a definite loop
loop control variable
Correct Answer:
Verified
Premises:
Responses:
A loop that never ends
garbage
The value of an uninitialized variable
outer loop
Another name for a definite loop
loop control variable
The amount by which a loop control variable changes on each cycle
do loop
Checks at the "bottom" of the loop after the first iteration
for loop
Contains an inner loop when loops are nested
empty body
A variable that controls the execution of a while loop
counted loop
A shorthand structure for programming a definite loop
infinite loop
A loop body with no statements in it
step value
Free
(Matching)
4.7/5
(42)
Correct Answer:
Verified

You can improve loop performance by using prefix incrementing.

Free
(True/False)
4.9/5
(32)
Correct Answer:
Verified

True

You begin a for statement with the keyword ____ followed by a set of parentheses.

(Multiple Choice)
4.8/5
(37)

One execution of any loop is called a(n) ____.

(Multiple Choice)
4.9/5
(41)

Statements in a while loop or for loop body can be blocked. Write a for loop that displays "Hello" and "Goodbye" four times each using a blocked loop body.

(Essay)
4.9/5
(32)

A value that a user must supply to stop a loop (for example, 'Y' or 'N' ) is called a(n) ____________________ value.

(Short Answer)
4.8/5
(35)

A loop for which the number of iterations is predetermined is called a(n) ____ loop.

(Multiple Choice)
4.7/5
(38)

When writing a while loop, how can you ensure that it will end correctly?

(Essay)
4.7/5
(26)

Write a short program that prints "Hello" on the console four times using a while loop.

(Essay)
4.9/5
(32)

When loop structures are nested, the inner loop must be entirely contained within the outer loop; loops can never overlap.

(True/False)
4.8/5
(30)

If you ever find yourself in the midst of executing an infinite loop, you can break out by holding down the ____ key and pressing the C key or the Break (Pause) key.

(Multiple Choice)
4.8/5
(44)

Some loops are controlled by ____ (or reducing) a variable and testing whether the value remains greater than some benchmark value.

(Multiple Choice)
5.0/5
(44)

Loop ____ is the technique of combining two loops into one.

(Multiple Choice)
4.9/5
(38)

Statements in a for loop body cannot be blocked.

(True/False)
4.9/5
(37)

You cannot use a while loop for indefinite loops.

(True/False)
4.7/5
(34)

The do  loop is a(n) ____ loop.

(Multiple Choice)
5.0/5
(31)

A while loop is a(n) ____ loop.

(Multiple Choice)
4.7/5
(39)

What tasks can be performed in the three sections of a for loop in addition to initializing a single variable, testing the variable, and incrementing it?

(Essay)
4.8/5
(37)

Because you need definite loops so frequently when you write programs, C# provides a shorthand way to create such a loop. This shorthand structure is called a(n) ____________________ loop.

(Short Answer)
4.8/5
(34)
Showing 1 - 20 of 42
close modal

Filters

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