Exam 6: Repeating Instructions

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

int counter = 0; while (counter < 100) { Console.WriteLine(counter); counter++; } -The first value printed with the program segment above is ____.

(Multiple Choice)
4.8/5
(86)

int counter = 0; while (counter < 100) { Console.WriteLine(counter); counter++; } -A method that calls itself repeatedly until it arrives at the solution is a(n)____method.

(Multiple Choice)
4.8/5
(90)

The ____________ statement is a pretest form of loop which is considered a specialized form of the while statement and is usually associated with counter-controlled types of loops;

(Short Answer)
4.8/5
(66)

int sum = 0; int number = 1; while (number < 100) { sum = sum + number; } The program statements above produce an infinite loop.

(True/False)
4.9/5
(81)

s = num.Next(7); The statement above produces seven random numbers.

(True/False)
4.9/5
(88)

for (int i = 0; i < 5; i++) Console.Write(i + "\t"); -Given the code snippet above,how many times will the loop body be executed?

(Multiple Choice)
5.0/5
(85)

for (int i = 0;i < 10;i++) { Console.WriteLine("counter " + i); } The variable i defined in the program segment above ____.

(Multiple Choice)
4.8/5
(75)

The sentinel value is used as the operand in the conditional expression for an indefinite loop.

(True/False)
4.9/5
(80)

A sentinel value is a(n)____________.It is a value that should not be processed.

(Short Answer)
4.8/5
(76)

A common problem associated with counter-controlled loops is not executing the loop for the last value.This type of problem is labeled a(n)____ error.

(Multiple Choice)
4.8/5
(95)

____________ loops are often used for inputting data when you do not know the exact number of values to be entered.

(Short Answer)
4.8/5
(80)

With nested loops,the outermost loop is always totally completed before the innermost loop is executed.

(True/False)
4.9/5
(92)

C# performs automatic garbage collection once the loop is finished and releases any variables declared as part of the loop.

(True/False)
4.8/5
(81)

In order to use the MessageBox.Show( )method in your console application,you must ____.

(Multiple Choice)
4.9/5
(91)

The do...while loop can be used to implement a counter-controlled,sentinel-controlled,or state-controlled loop.

(True/False)
4.7/5
(81)
Showing 61 - 75 of 75
close modal

Filters

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