Exam 6: Looping

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

The order of the conditional expressions in the following is most important within a(n) ____ loop.   while(requestedNum > LIMIT || requestedNum

(Multiple Choice)
4.8/5
(45)

Describe a counter-controlled loop. Explain the process of incrementing and decrementing, and explain the best method for executing a loop a specific number of times.

(Essay)
4.9/5
(30)

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

(Short Answer)
4.8/5
(36)

   Using the information provided above, write the while loop that will correctly follow the execution of the flowchart. Using the information provided above, write the while loop that will correctly follow the execution of the flowchart.

(Essay)
4.9/5
(33)

Write a definite while loop that initializes a loop control variable named decreaseOne to 10 and continues while  decreaseOne > 0. Decrement the loop control variable by 1 and include the println output "Keep going" within the loop.

(Essay)
4.8/5
(36)

On many keyboards, the Break key is also the ____ key.

(Multiple Choice)
4.8/5
(41)

You can use virtually any number of nested loops; however, at some point, your machine will no longer be able to store all the necessary looping information.

(True/False)
4.9/5
(40)

In the expressions b = 8 and c = --b , what value will be assigned to the variable c ?

(Multiple Choice)
4.8/5
(36)

Explain why an infinite loop might not actually execute infinitely.

(Essay)
4.9/5
(47)

In a do…while loop, the loop will continue to execute until ____.

(Multiple Choice)
4.9/5
(45)

A(n) ____________________ is a body with no statements in it.

(Short Answer)
4.8/5
(47)

The process of repeatedly increasing a value by some amount is known as ____.

(Multiple Choice)
4.8/5
(40)

How could you rewrite the following code to have the arithmetic performed only once, even if the loop executes 1,000 times? while (x // loop body

(Essay)
4.9/5
(40)

How are indefinite loops used for validating data? Why is a loop structure typically the better choice for validating data than an if statement?

(Essay)
4.9/5
(29)

counterLoop = 1; while(counterLoop {      System.out.println("Hello");      counterLoop = counterLoop + 1; } What is the problem in the above while loop? How would you correct the problem?

(Essay)
4.7/5
(42)

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

(Essay)
4.7/5
(42)

What are some of the shortcuts Java provides programmers for incrementing and accumulating? Give examples of statements.

(Essay)
4.8/5
(39)

When nesting loops, the variable in the outer loop changes more frequently.

(True/False)
4.8/5
(45)

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

(Multiple Choice)
4.8/5
(32)

   Using the flowchart and code above, describe the execution of the loop. Identify the loop control variable and the value of the variable as the code is executed. Using the flowchart and code above, describe the execution of the loop. Identify the loop control variable and the value of the variable as the code is executed.

(Essay)
4.8/5
(36)
Showing 41 - 60 of 66
close modal

Filters

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