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 Collections74 Questions
Exam 9: Introduction to Windows Programming75 Questions
Exam 10: Programming Based on Events75 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 Applications73 Questions
Select questions type
The event-driven model used to create Windows applications ____.
Free
(Multiple Choice)
4.8/5
(47)
Correct Answer:
D
The do...while loop can be used to implement a counter-controlled, sentinel-controlled, or state-controlled loop.
Free
(True/False)
5.0/5
(34)
Correct Answer:
True
int inner; for (int outer = 0; outer < 3; outer++)
{
For (inner = 1; inner < 2; inner++)
Console.WriteLine("Outer: {0}\tInner: {1}", outer, inner);
}
The nested for statement above displays how many lines of output?
Free
(Multiple Choice)
4.8/5
(41)
Correct Answer:
B
int loopVariable = 0; do
{
Console.WriteLine("Count = {0:}", ++loopVariable);
}while (loopVariable < 5);
How many times will be loop body be executed?
(Multiple Choice)
4.9/5
(33)
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
(32)
A sentinel controlled loop is also called a flag-controlled loop.
(True/False)
4.9/5
(39)
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.7/5
(30)
Windows applications use an event-driven model to manage the interaction between the user and the GUI by handling the repetition for you.
(True/False)
4.8/5
(38)
The ___________ loop structure, which restricts access to read-only, is used to iterate or move through a collection, such as an array.
(Short Answer)
4.8/5
(33)
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
(37)
With counter controlled loops, it is important to think through and ____________ to ensure they have been taken into consideration. You should always check the initial and final values of the loop control variable and verify that you get the expected results at the boundaries.
(Short Answer)
4.9/5
(43)
To "prime the read" with a loop, you place an input statement ____.
(Multiple Choice)
4.8/5
(35)
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
(25)
if (int.TryParse(inStringValue, out integerValue) == false)
Console.WriteLine("Invalid input - 0 recorded for end value");
If a character such as "b" is entered by the user and stored in inStringValue, TryParse( )
returns ____________.
(Short Answer)
4.8/5
(28)
for (int outer = 0; outer < 2; outer++) {
For (int inner = 0; inner < 3; inner++)
{
Console.WriteLine("Outer: {0}\tInner: {1}", outer, inner);
}
}
During the last iteration through the nested loop, what numbers are printed?
(Multiple Choice)
4.8/5
(41)
The do...while statement is a posttest loop, which means that the conditional expression is tested before any of the statements in the body of the loop are performed.
(True/False)
4.8/5
(43)
With while loops, if the conditional expression evaluates to true, the body of the loop is not performed; control transfers to the statements following the loop.
(True/False)
4.7/5
(32)
With nested loops, the outermost loop is always totally completed before the innermost loop is executed.
(True/False)
4.8/5
(44)
A sentinel value is a(n) ____________. It is a value that should not be processed.
(Short Answer)
4.8/5
(38)
Showing 1 - 20 of 75
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)