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
int counter = 0; while (counter < 100)
{
Console.WriteLine(counter);
Counter++;
}
The first value printed with the program segment above is ____.
(Multiple Choice)
4.7/5
(41)
The only posttest loop structure available with C# is the ____________ loop structure.
(Short Answer)
4.8/5
(38)
The loop control structure used to move through a collection (group of data items) that does not require you to increment a loop control variable or test the expression to determine when all data has been processed is the ____ statement.
(Multiple Choice)
4.8/5
(35)
What is a requirement of the sentinel-controlled loop shared by counter-controlled loops?
(Multiple Choice)
4.7/5
(36)
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.7/5
(36)
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.7/5
(37)
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)
4.7/5
(37)
The most appropriate sentinel value that might be selected for month of the year is ____.
(Multiple Choice)
4.9/5
(34)
Instead of requiring that a dummy value be entered after all values are processed, a ____-controlled loop initializes a variable on the outside of the loop and then evaluates the variable to see when it changes values. Its value is changed inside the loop body when the loop should exit.
(Multiple Choice)
4.8/5
(37)
When you know the number of times the statements must be executed, create a(n) ____________ loop.
(Short Answer)
4.9/5
(32)
An off-by-one error is a common problem associated with counter-controlled loops where the loop body is performed one too many or one too few times.
(True/False)
4.9/5
(34)
To write a recursive solution, a base case needs to be identified.
(True/False)
4.8/5
(38)
The while statement is the only type of loop construct that can be used to develop a sentinel-controlled loop.
(True/False)
4.9/5
(35)
A(n) ____________ is a loop that has no provisions for termination.
(Short Answer)
4.9/5
(29)
The third programming construct repetition is also called ____________.
(Short Answer)
4.7/5
(32)
A restriction on using the foreach statement is that you cannot change values in the collection. The access to the elements is read-only.
(True/False)
4.7/5
(37)
____________ 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
(32)
If a numeric variable is being changed by a consistent amount with each iteration through the loop, the while statement is the best choice of loop constructs.
(True/False)
4.9/5
(36)
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)
5.0/5
(39)
An advantage of sentinel-controlled loops is you do not need to know how many times the loop will be performed.
(True/False)
4.9/5
(35)
Showing 21 - 40 of 75
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)