Exam 6: Repeating Instructions
Exam 1: Introduction to Computing and Programming75 Questions
Exam 2: Data Types and Expressions75 Questions
Exam 3: Methods and Behaviors75 Questions
Exam 4: Creating Your Own Classes75 Questions
Exam 5: Making Decisions75 Questions
Exam 6: Repeating Instructions75 Questions
Exam 7: Arrays75 Questions
Exam 8: Advanced Collections75 Questions
Exam 9: Introduction to Windows Programming75 Questions
Exam 10: Programming Based on Events74 Questions
Exam 11: Advanced Object-Oriented Programming Features75 Questions
Exam 12: Debugging and Handling Exceptions75 Questions
Exam 13: Working with Files75 Questions
Exam 14: Working with Databases75 Questions
Exam 15: Web-Based Applications75 Questions
Select questions type
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)