Exam 6: Loops

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

Which of the following loops will print the odd numbers between 0 and 20?

(Multiple Choice)
4.8/5
(43)

The command line interface of your operating system provides a way to link a file to the input of a program.What is this process called?

(Multiple Choice)
4.8/5
(43)

What for loop can be used in the indicated area so the code will print: What for loop can be used in the indicated area so the code will print:

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.9/5
(47)

How many times will the following loop run? How many times will the following loop run?

(Multiple Choice)
4.8/5
(44)

Is the following code snippet legal? Is the following code snippet legal?

(Multiple Choice)
4.8/5
(43)

Consider the following loop: int n=1; double x=0; double s; do { s=1.0 /(n * n) ; x=x+5 ; n++; } while (s>0.01); System. out. println(x); Which loop below is an equivalent loop?

(Multiple Choice)
4.8/5
(28)

Which of the following should be used when you need to ask a user to enter one data item and repeat the prompt if the data is invalid? I.the for loop II.the while loop III.the do loop

(Multiple Choice)
4.9/5
(32)

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

(Multiple Choice)
4.9/5
(41)

How many times does the code snippet given below display "Loop Execution"? How many times does the code snippet given below display Loop Execution?

(Multiple Choice)
4.9/5
(35)

Given the following code snippet, what should we change to have 26 alphabet characters in the string str? Given the following code snippet, what should we change to have 26 alphabet characters in the string str?

(Multiple Choice)
4.9/5
(36)

How many times does the loop execute in the following code fragment? How many times does the loop execute in the following code fragment?

(Multiple Choice)
4.9/5
(35)

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

Which of the following statements is true about the variable sum in the code snippet below? Which of the following statements is true about the variable sum in the code snippet below?

(Multiple Choice)
4.8/5
(36)

What does the following code snippet display? What does the following code snippet display?

(Multiple Choice)
4.9/5
(43)

What does the following code snippet print? What does the following code snippet print?

(Multiple Choice)
4.9/5
(43)

Which of the following conditions can be added to the code below so it will loop until the user enters "no" or "NO"? Which of the following conditions can be added to the code below so it will loop until the user enters no or NO?

(Multiple Choice)
4.9/5
(37)

This code snippet is intended to calculate the balance of an account after twenty years of gaining interest.Select the statement that correctly completes the loop. This code snippet is intended to calculate the balance of an account after twenty years of gaining interest.Select the statement that correctly completes the loop.

(Multiple Choice)
4.7/5
(43)

Suppose you must design a program to calculate the roll-out (number of inches travelled in one revolution of the pedals of a bicycle based on its gear combinations). The user will provide the gear sizes, which must be converted into roll-out for all different gear combinations. How can the flow of user interaction for this problem be designed?

(Multiple Choice)
4.9/5
(32)

Which code snippet produces the sum of the first n even numbers?

(Multiple Choice)
4.9/5
(36)
Showing 41 - 60 of 107
close modal

Filters

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