Exam 6: Looping

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags
Match each term with the correct statement below.
Premises:
Operate on two values
Responses:
% =
data validation
for loop
Correct Answer:
Verified
Premises:
Responses:
Operate on two values
% =
(Matching)
4.8/5
(38)

What is wrong with the following code? x=1; While (x<5);  { System.out.println (x);    x++; }

(Multiple Choice)
4.8/5
(29)

Assume  d and x are integers: d = 5; X = 2 * ++d; What is the value of x ?

(Multiple Choice)
4.8/5
(33)
Match each term with the correct statement below.
Premises:
Repeatedly increasing a value by an amount
Responses:
data validation
binary operators
% =
Correct Answer:
Verified
Premises:
Responses:
Repeatedly increasing a value by an amount
data validation
(Matching)
4.8/5
(34)

You can initialize more than one variable in a for loop by placing a(n) ____ between the separate statements.

(Multiple Choice)
4.9/5
(42)

while(10 > 1) {    System.out.println("This prints forever."); } Identify the problem that exists in the above while loop.

(Essay)
4.8/5
(41)

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

(True/False)
4.7/5
(24)
Match each term with the correct statement below.
Premises:
A counted loop
Responses:
decrementing
block
sleep() method
Correct Answer:
Verified
Premises:
Responses:
A counted loop
decrementing
(Matching)
5.0/5
(37)

What is the output of the following code:​ loopCount = 1; While(loopCount < 3)    System.out.println("Hello");    loopCount = loopCount + 1;

(Multiple Choice)
4.7/5
(37)
Match each term with the correct statement below.
Premises:
The value that determines whether loop execution continues
Responses:
empty body
loop fusion
loop control variable
Correct Answer:
Verified
Premises:
Responses:
The value that determines whether loop execution continues
empty body
(Matching)
4.8/5
(38)

What is the output of the following code: for (loop = 1; loop <3; ++loop)    System.out.print(1);    for (loop2 = 1; loop2< 3; ++loop2)       System.out.print(2);

(Multiple Choice)
4.9/5
(42)
Match each term with the correct statement below.
Premises:
Ensuring that a value is in a range
Responses:
loop control variable
empty body
accumulating
Correct Answer:
Verified
Premises:
Responses:
Ensuring that a value is in a range
loop control variable
(Matching)
4.7/5
(34)

How are nested loops implemented in a loop structure?

(Essay)
4.8/5
(36)

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

(Multiple Choice)
4.9/5
(42)

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

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

(Multiple Choice)
4.9/5
(40)

Which of the following is NOT a valid method to increase a variable named score by 1?

(Multiple Choice)
4.8/5
(37)

A counted loop is the same as an indefinite loop.

(True/False)
4.8/5
(35)

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

(Multiple Choice)
4.8/5
(44)

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

(Multiple Choice)
4.8/5
(43)
Showing 41 - 60 of 77
close modal

Filters

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