Exam 6: Looping

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

When you want to increase a variable's value by exactly 1, use the ____.

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

D

It is important that the loop control ____ be altered within the body of the loop.

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

B

Match each term with the correct statement below.
Operate on two values
for loop
The technique of combining two loops into one
decrementing
Part of the Thread class in the java.lang package
loop control variable
Correct Answer:
Verified
Premises:
Responses:
Operate on two values
for loop
The technique of combining two loops into one
decrementing
Part of the Thread class in the java.lang package
loop control variable
The value that determines whether loop execution continues
loop fusion
Multiple statements within curly braces
sleep() method
Within parentheses are three sections separated by exactly two semicolons
block
A shortcut for incrementing and accumulating
binary operators
A countered loop
prefix ++
Subtracting 1 from a variable
definite loop
Free
(Matching)
4.8/5
(34)
Correct Answer:
Verified

A(n) ____ loop is a special loop that is used when a definite number of loop iterations is required.

(Multiple Choice)
4.8/5
(46)

In order to improve loop performance, it's important to make sure the loop does not include unnecessary operations or statements.

(True/False)
4.8/5
(36)

____ is the process of ensuring that a value falls within a specified range.

(Multiple Choice)
4.9/5
(33)

Before entering a loop, the first input statement, or ____, is retrieved.

(Multiple Choice)
4.8/5
(39)

As long as methods do not depend on one another, ____ is a technique that can improve loop performance by combining two loops into one.

(Multiple Choice)
4.9/5
(31)

The ____ loop checks the value of the loop control variable at the bottom of the loop after one repetition has occurred.

(Multiple Choice)
4.7/5
(37)

Why would a loop with altered user input be considered a type of indefinite loop? Give an example.

(Essay)
4.8/5
(40)

A ____ is a structure that allows repeated execution of a block of statements.

(Multiple Choice)
4.8/5
(37)

The statements that make up a loop body will continue to execute as long as the expression value remains false.

(True/False)
4.8/5
(37)

Altering a variable within both a for statement and within the block it controls can produce errors that are difficult to find.

(True/False)
4.9/5
(45)

A statement that will alter the value of the loop control variable is included in the body of a loop.

(True/False)
4.9/5
(31)

How could a programmer identify and escape from an infinite loop?

(Essay)
4.9/5
(40)

A for loop provides a convenient way to create a(n) ____ loop.

(Multiple Choice)
4.8/5
(34)

Which is an infinite loop?

(Multiple Choice)
4.9/5
(32)

while(count Examine the statement above. Write the code that will result in more efficient program execution assuming the result of getNumberOfEmployees() stays the same.

(Essay)
4.7/5
(41)

A loop controlled by the user is a type of ____ loop.

(Multiple Choice)
4.7/5
(36)

What would happen if a semicolon is mistakenly placed at the end of a partial statement of a while loop with a Boolean expression and with an empty body?

(Essay)
4.8/5
(41)
Showing 1 - 20 of 66
close modal

Filters

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