Exam 6: Repeating Instructions

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

With the while loop,the body of the loop is ____.

(Multiple Choice)
4.9/5
(84)

int loopVariable = 0; do { Console.WriteLine("Count = {0:}", ++loopVariable); }while (loopVariable < 5); -How many times will be loop body be executed if the conditional expression is changed to (loopVariable == 5)?

(Multiple Choice)
4.9/5
(80)

In order to use the MessageBox.Show( )method,you need to not only add a reference to the namespace which includes the class,but also add a using directive to the program statements.

(True/False)
4.8/5
(79)

Which of the following is an advantage of a sentinel-controlled loop?

(Multiple Choice)
4.8/5
(82)

Unlike the sentinel-controlled loop,the variable used with a state-controlled loop differs from the variable used to store the data that is being processed.

(True/False)
4.9/5
(70)

To "prime the read" with a loop,you place an input statement ____.

(Multiple Choice)
4.8/5
(76)

To write a recursive solution,a base case needs to be identified.

(True/False)
4.9/5
(87)

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

(Multiple Choice)
4.9/5
(79)

int counter = 0; while (counter < 100) { Console.WriteLine(counter); counter++; } -Looking above,if the loop body was changed from counter++;to counter += 5;,how many times would the loop body be executed?

(Multiple Choice)
4.9/5
(75)

A state-controlled loop should be designed when you know the number of times the statements must be executed.

(True/False)
4.7/5
(85)

During the last iteration through the nested loop,what numbers are printed?

(Multiple Choice)
4.8/5
(81)

int loopVariable = 0; do { Console.WriteLine("Count = {0:}", ++loopVariable); }while (loopVariable < 5); -How many times will be loop body be executed?

(Multiple Choice)
5.0/5
(77)

Inside the for statement,when you place a semicolon after the parentheses without anything to the left of it,it indicates that no statement or a(n)____________ statement is associated with the initialize portion.

(Short Answer)
4.8/5
(71)

An example for statement that has a compound initialization,compound test and compound update could be written as ____.

(Multiple Choice)
4.8/5
(88)

int loopVariable = 0; do { Console.WriteLine("Count = {0:}", ++loopVariable); }while (loopVariable < 5); -What will be printed during the first iteration through the loop?

(Multiple Choice)
4.9/5
(85)

What is NOT required when a counter-controlled loop is created?

(Multiple Choice)
4.9/5
(81)

The for statement is a compact method of writing the loops that can be written using while;it packages together the ____________,test,and update all on one line.

(Short Answer)
4.9/5
(79)

The conditional expression is sometimes called the loop condition.

(True/False)
4.9/5
(73)

for (int outer = 0; outer < 2; outer++) { for (int inner = 0; inner < 3; inner++) { Console.WriteLine("Outer: {0}\tInner: {1}", outer, inner); } } -How many lines will be printed for the above nested loop?

(Multiple Choice)
4.8/5
(72)

Which of the following is NOT a keyword used to enable unconditional transfer of control to a different program statement?

(Multiple Choice)
4.8/5
(79)
Showing 21 - 40 of 75
close modal

Filters

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