Exam 6: Loops

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

Which of the following loops executes 8 times?

(Multiple Choice)
4.8/5
(36)

How do you fix this code snippet to make it print out the sum when the user enters a letter rather than a double? The user must enter at least one double when the program begins. How do you fix this code snippet to make it print out the sum when the user enters a letter rather than a double? The user must enter at least one double when the program begins.

(Multiple Choice)
4.7/5
(38)

What is the best strategy for avoiding off-by-one errors?

(Multiple Choice)
4.7/5
(39)

What are the values of i and j after the following code fragment runs? What are the values of i and j after the following code fragment runs?

(Multiple Choice)
4.9/5
(46)

What is the output of this code snippet if the user enters the numbers What is the output of this code snippet if the user enters the numbers   ?   ? What is the output of this code snippet if the user enters the numbers   ?

(Multiple Choice)
4.8/5
(44)

When hand-tracing a portion of code, which statement about Boolean conditions is true?

(Multiple Choice)
4.9/5
(36)

A loop inside another loop is called a

(Multiple Choice)
4.8/5
(34)

Which of the following conditions can be added to the code below so it will loop until the value of sum is greater than 100? Which of the following conditions can be added to the code below so it will loop until the value of sum is greater than 100?

(Multiple Choice)
4.7/5
(42)

Suppose that a program asks a user to enter multiple integers, either positive or negative, to do some calculation.The data entry will stop when the user enters a certain value to indicate the end of the data.What value should the program use as the sentinel?

(Multiple Choice)
4.9/5
(37)

What is the output of the following code snippet? What is the output of the following code snippet?

(Multiple Choice)
4.9/5
(38)

What is the output of the code snippet given below? What is the output of the code snippet given below?

(Multiple Choice)
4.9/5
(33)

What is the output of the code fragment given below? What is the output of the code fragment given below?

(Multiple Choice)
4.9/5
(37)

How many times is the text "Let's have fun with Java." printed when this code snippet is run? How many times is the text Let's have fun with Java. printed when this code snippet is run?

(Multiple Choice)
4.9/5
(38)

What will be the output of the following code snippet? What will be the output of the following code snippet?

(Multiple Choice)
4.8/5
(47)

What are the values of i and j after the following code snippet is run? What are the values of i and j after the following code snippet is run?

(Multiple Choice)
4.7/5
(40)

In the __________ loop header, you can include multiple update expressions, separated by commas, but it is not recommended.

(Multiple Choice)
4.8/5
(36)

Which statement about this code snippet is accurate? Which statement about this code snippet is accurate?

(Multiple Choice)
5.0/5
(28)

Which of the statements about hand-tracing is true?

(Multiple Choice)
4.9/5
(47)

What is the output of the code snippet given below? What is the output of the code snippet given below?

(Multiple Choice)
4.7/5
(41)

How many times will the output line be printed in the following code snippet? How many times will the output line be printed in the following code snippet?

(Multiple Choice)
4.8/5
(39)
Showing 21 - 40 of 107
close modal

Filters

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