Deck 6: Repeating Instructions

ملء الشاشة (f)
exit full mode
سؤال
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.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
s = num.Next(7);
The statement above produces seven random numbers.
سؤال
The sentinel value is used as the operand in the conditional expression for an indefinite loop.
سؤال
The while statement is the only type of loop construct that can be used to develop a sentinel-controlled loop.
سؤال
An advantage of sentinel-controlled loops is you do not need to know how many times the loop will be performed.
سؤال
The conditional expression is sometimes called the loop condition.
سؤال
int sum = 0;
int number = 1;
while (number < 100)
{
sum = sum + number;
}
The program statements above produce an infinite loop.
سؤال
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.
سؤال
Class diagrams show the data,method,and property members of a class.
سؤال
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.
سؤال
Iteration is a technique used where a method calls itself repeatedly until it arrives at the solution.
سؤال
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.
سؤال
Windows applications use an event-driven model to manage the interaction between the user and the GUI by handling the repetition for you.
سؤال
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.
سؤال
int sum = 0;
int number = 0;
while (number < 10)
{
sum = sum + number;
Console.WriteLine(sum);
}
The statement above prints the values of 0 through 9 on separate lines.
سؤال
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.
سؤال
You often need to do a "prime the read" for counter controlled loops which means that you would input a value before going into the body of the loop.
سؤال
To write a recursive solution,a base case needs to be identified.
سؤال
Using the break or continue statements with a loop violates the single entry and single exit guideline for developing a loop.
سؤال
A sentinel controlled loop is also called a flag-controlled loop.
سؤال
With the while loop,the body of the loop is ____.

A) always performed at least one time
B) performed as long as the conditional expression evaluates to true
C) must produce a boolean result
D) must be enclosed in curly braces
سؤال
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.

A) off-by-one
B) last-value
C) counter controlled
D) boundaries
سؤال
Without incrementing the counter used in the conditional expression with counter controlled loops,the loop would go on indefinitely.
سؤال
The do...while loop can be used to implement a counter-controlled,sentinel-controlled,or state-controlled loop.
سؤال
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?

A) 19
B) 20
C) 99
D) 100
سؤال
In C# curly braces must be added to surround all loop bodies.
سؤال
C# performs automatic garbage collection once the loop is finished and releases any variables declared as part of the loop.
سؤال
One of the major strengths of programming languages can be attributed to loops.
سؤال
An interpretation of the while statement is "while the condition is true,perform statement(s)".
سؤال
What is NOT required when a counter-controlled loop is created?

A) Initializing loop control variable on the outside of the loop.
B) Incrementing the loop control variable inside the loop.
C) A conditional expression involving the loop control variable.
D) Allowing the user to enter a value indicating the loop should stop.
سؤال
In order to write a recursive solution ____.

A) the simplest case should be determined
B) you must create an infinite loop
C) write the iterative solution first
D) the most complicated approach must be identified
سؤال
With nested loops,the outermost loop is always totally completed before the innermost loop is executed.
سؤال
int counter = 0;
while (counter < 100)
{
Console.WriteLine(counter);
counter++;
}
The most appropriate sentinel value that might be selected for month of the year is ____.

A) 0
B) 1
C) 6
D) 12
سؤال
Scope refers to the region in the program in which you can use the variable.
سؤال
Which of the following is an advantage of a sentinel-controlled loop?

A) The number of iterations does not have to be known.
B) An extreme or dummy value can be entered.
C) The loop is always performed at least one time.
D) It could be used with the while form of the loop.
سؤال
int counter = 0;
while (counter < 100)
{
Console.WriteLine(counter);
counter++;
}
The last value printed with the above program segment is ____.

A) 0
B) 1
C) 99
D) 100
سؤال
A restriction on using the foreach statement is that you cannot change values in the collection.The access to the elements is read-only.
سؤال
A state-controlled loop should be designed when you know the number of times the statements must be executed.
سؤال
int counter = 0;
while (counter < 100)
{
Console.WriteLine(counter);
counter++;
}
The first value printed with the program segment above is ____.

A) 0
B) 1
C) 99
D) 100
سؤال
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.

A) static
B) recursive
C) iterative
D) instance
سؤال
A flag-controlled loop is also called a ____.

A) sentinel-controlled loop
B) counter-controlled loop
C) state-controlled loop
D) posttest form loop
سؤال
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?

A) 2
B) 3
C) 5
D) 6
سؤال
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.

A) counter
B) sentinel
C) state
D) change
سؤال
What is a requirement of the sentinel-controlled loop shared by counter-controlled loops?

A) The conditional expression must be set up prior to the loop.
B) A counter must be initialized on the outside of the loop.
C) A counter must be incremented inside the loop body.
D) The expression must evaluate to false in order for the loop to be executed.
سؤال
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.

A) while
B) for
C) do...while
D) foreach
سؤال
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?

A) 2
B) 3
C) 5
D) 6
سؤال
During the last iteration through the nested loop,what numbers are printed?

A) Outer: 1 Inner: 2
B) Outer: 2 Inner 3
C) Outer: 3 Inner 0
D) Outer: 1 Inner 0
سؤال
int loopVariable = 0;
do
{
Console.WriteLine("Count = {0:}", ++loopVariable);
}while (loopVariable < 5);
How many times will be loop body be executed?

A) 0
B) 4
C) 5
D) 6
سؤال
for (int i = 0; i < 5; i++)
Console.Write(i + "\t");
The conditional expression used with the for statement ____.

A) must involve a counter
B) must evaluate to false in order for the loop body to be executed
C) is evaluates after the loop body is performed once
D) is written following the first semicolon
سؤال
An example for statement that has a compound initialization,compound test and compound update could be written as ____.

A) for (int r = 0; c = 5; r < 3 && c > 2; r++; c--)
B) for (int r = 0; c = 5; r < 3 ; c > 2; r++; c--)
C) for (int r = 0, c = 5; r < 3, c > 2; r++, c--)
D) for (int r = 0, c = 5; r < 3 && c > 2; r++, c--)
سؤال
int loopVariable = 0;
do
{
Console.WriteLine("Count = {0:}", ++loopVariable);
}while (loopVariable < 5);
What will be printed during the first iteration through the loop?

A) 0
B) 1
C) 10
D) none of the above
سؤال
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)?

A) 0
B) 4
C) 5
D) 6
سؤال
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?

A) 4
B) 5
C) 6
D) 10
سؤال
Which of the following is NOT a keyword used to enable unconditional transfer of control to a different program statement?

A) continue
B) break
C) goto
D) while
سؤال
In order to use the MessageBox.Show( )method in your console application,you must ____.

A) enclose the method call in a body of a loop
B) add a reference to the System.Windows.Forms.dll.
C) add a using System.MessageBox directive
D) call on the method from within the WriteLine( ) or Write( ) methods
سؤال
You must tell the user what value to type to end the loop for ____.

A) counter-controlled loops
B) state-controlled loops
C) sentinel-controlled loops
D) any type of loop
سؤال
The only posttest loop structure available in C# is _____.

A) while
B) for
C) do...while
D) foreach
سؤال
The event-driven model used to create Windows applications ____.

A) uses a counter-controlled form of loop
B) uses a state-controlled form of loop
C) uses a sentinel-controlled form of loop
D) handles the repetition for you
سؤال
for (int i = 0;i < 10;i++) {
Console.WriteLine("counter " + i);
}
The variable i defined in the program segment above ____.

A) is out of scope when the loop terminates
B) creates an error because it is changed in the update portion
C) would have a value of 10 if it were printed on the outside of the loop
D) can be displayed prior to the loop program statements
سؤال
To "prime the read" with a loop,you place an input statement ____.

A) inside the loop body
B) before the loop body
C) after the loop body
D) as part of the loop conditional expression
سؤال
When you know the number of times the statements must be executed,create a(n)____________ loop.
سؤال
The _____________ method of the MessageBox class displays a predefined dialog box that can contain text,captions for the title bar,special buttons,and icons.
سؤال
A(n)____________ is a loop that has no provisions for termination.
سؤال
An option other than looping that can be used to repeat program statement is _____________.With this technique a method calls itself repeatedly until it arrives at the solution.
سؤال
The third programming construct repetition is also called ____________.
سؤال
A sentinel value is a(n)____________.It is a value that should not be processed.
سؤال
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.
سؤال
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;
سؤال
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 ____________.
سؤال
____________ loops are often used for inputting data when you do not know the exact number of values to be entered.
سؤال
The ___________ loop structure,which restricts access to read-only,is used to iterate or move through a collection,such as an array.
سؤال
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.
سؤال
The only posttest loop structure available with C# is the ____________ loop structure.
سؤال
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.
سؤال
When one of the program statement included within the body of a loop is another loop,a(n)____________ loop is created.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Repeating Instructions
1
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
2
s = num.Next(7);
The statement above produces seven random numbers.
False
3
The sentinel value is used as the operand in the conditional expression for an indefinite loop.
True
4
The while statement is the only type of loop construct that can be used to develop a sentinel-controlled loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
5
An advantage of sentinel-controlled loops is you do not need to know how many times the loop will be performed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
6
The conditional expression is sometimes called the loop condition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
7
int sum = 0;
int number = 1;
while (number < 100)
{
sum = sum + number;
}
The program statements above produce an infinite loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
8
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
9
Class diagrams show the data,method,and property members of a class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
10
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
11
Iteration is a technique used where a method calls itself repeatedly until it arrives at the solution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
12
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
13
Windows applications use an event-driven model to manage the interaction between the user and the GUI by handling the repetition for you.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
14
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
15
int sum = 0;
int number = 0;
while (number < 10)
{
sum = sum + number;
Console.WriteLine(sum);
}
The statement above prints the values of 0 through 9 on separate lines.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
16
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
17
You often need to do a "prime the read" for counter controlled loops which means that you would input a value before going into the body of the loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
18
To write a recursive solution,a base case needs to be identified.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
19
Using the break or continue statements with a loop violates the single entry and single exit guideline for developing a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
20
A sentinel controlled loop is also called a flag-controlled loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
21
With the while loop,the body of the loop is ____.

A) always performed at least one time
B) performed as long as the conditional expression evaluates to true
C) must produce a boolean result
D) must be enclosed in curly braces
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
22
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.

A) off-by-one
B) last-value
C) counter controlled
D) boundaries
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
23
Without incrementing the counter used in the conditional expression with counter controlled loops,the loop would go on indefinitely.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
24
The do...while loop can be used to implement a counter-controlled,sentinel-controlled,or state-controlled loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
25
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?

A) 19
B) 20
C) 99
D) 100
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
26
In C# curly braces must be added to surround all loop bodies.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
27
C# performs automatic garbage collection once the loop is finished and releases any variables declared as part of the loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
28
One of the major strengths of programming languages can be attributed to loops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
29
An interpretation of the while statement is "while the condition is true,perform statement(s)".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
30
What is NOT required when a counter-controlled loop is created?

A) Initializing loop control variable on the outside of the loop.
B) Incrementing the loop control variable inside the loop.
C) A conditional expression involving the loop control variable.
D) Allowing the user to enter a value indicating the loop should stop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
31
In order to write a recursive solution ____.

A) the simplest case should be determined
B) you must create an infinite loop
C) write the iterative solution first
D) the most complicated approach must be identified
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
32
With nested loops,the outermost loop is always totally completed before the innermost loop is executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
33
int counter = 0;
while (counter < 100)
{
Console.WriteLine(counter);
counter++;
}
The most appropriate sentinel value that might be selected for month of the year is ____.

A) 0
B) 1
C) 6
D) 12
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
34
Scope refers to the region in the program in which you can use the variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following is an advantage of a sentinel-controlled loop?

A) The number of iterations does not have to be known.
B) An extreme or dummy value can be entered.
C) The loop is always performed at least one time.
D) It could be used with the while form of the loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
36
int counter = 0;
while (counter < 100)
{
Console.WriteLine(counter);
counter++;
}
The last value printed with the above program segment is ____.

A) 0
B) 1
C) 99
D) 100
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
37
A restriction on using the foreach statement is that you cannot change values in the collection.The access to the elements is read-only.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
38
A state-controlled loop should be designed when you know the number of times the statements must be executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
39
int counter = 0;
while (counter < 100)
{
Console.WriteLine(counter);
counter++;
}
The first value printed with the program segment above is ____.

A) 0
B) 1
C) 99
D) 100
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
40
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.

A) static
B) recursive
C) iterative
D) instance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
41
A flag-controlled loop is also called a ____.

A) sentinel-controlled loop
B) counter-controlled loop
C) state-controlled loop
D) posttest form loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
42
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?

A) 2
B) 3
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
43
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.

A) counter
B) sentinel
C) state
D) change
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
44
What is a requirement of the sentinel-controlled loop shared by counter-controlled loops?

A) The conditional expression must be set up prior to the loop.
B) A counter must be initialized on the outside of the loop.
C) A counter must be incremented inside the loop body.
D) The expression must evaluate to false in order for the loop to be executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
45
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.

A) while
B) for
C) do...while
D) foreach
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
46
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?

A) 2
B) 3
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
47
During the last iteration through the nested loop,what numbers are printed?

A) Outer: 1 Inner: 2
B) Outer: 2 Inner 3
C) Outer: 3 Inner 0
D) Outer: 1 Inner 0
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
48
int loopVariable = 0;
do
{
Console.WriteLine("Count = {0:}", ++loopVariable);
}while (loopVariable < 5);
How many times will be loop body be executed?

A) 0
B) 4
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
49
for (int i = 0; i < 5; i++)
Console.Write(i + "\t");
The conditional expression used with the for statement ____.

A) must involve a counter
B) must evaluate to false in order for the loop body to be executed
C) is evaluates after the loop body is performed once
D) is written following the first semicolon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
50
An example for statement that has a compound initialization,compound test and compound update could be written as ____.

A) for (int r = 0; c = 5; r < 3 && c > 2; r++; c--)
B) for (int r = 0; c = 5; r < 3 ; c > 2; r++; c--)
C) for (int r = 0, c = 5; r < 3, c > 2; r++, c--)
D) for (int r = 0, c = 5; r < 3 && c > 2; r++, c--)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
51
int loopVariable = 0;
do
{
Console.WriteLine("Count = {0:}", ++loopVariable);
}while (loopVariable < 5);
What will be printed during the first iteration through the loop?

A) 0
B) 1
C) 10
D) none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
52
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)?

A) 0
B) 4
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
53
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?

A) 4
B) 5
C) 6
D) 10
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
54
Which of the following is NOT a keyword used to enable unconditional transfer of control to a different program statement?

A) continue
B) break
C) goto
D) while
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
55
In order to use the MessageBox.Show( )method in your console application,you must ____.

A) enclose the method call in a body of a loop
B) add a reference to the System.Windows.Forms.dll.
C) add a using System.MessageBox directive
D) call on the method from within the WriteLine( ) or Write( ) methods
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
56
You must tell the user what value to type to end the loop for ____.

A) counter-controlled loops
B) state-controlled loops
C) sentinel-controlled loops
D) any type of loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
57
The only posttest loop structure available in C# is _____.

A) while
B) for
C) do...while
D) foreach
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
58
The event-driven model used to create Windows applications ____.

A) uses a counter-controlled form of loop
B) uses a state-controlled form of loop
C) uses a sentinel-controlled form of loop
D) handles the repetition for you
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
59
for (int i = 0;i < 10;i++) {
Console.WriteLine("counter " + i);
}
The variable i defined in the program segment above ____.

A) is out of scope when the loop terminates
B) creates an error because it is changed in the update portion
C) would have a value of 10 if it were printed on the outside of the loop
D) can be displayed prior to the loop program statements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
60
To "prime the read" with a loop,you place an input statement ____.

A) inside the loop body
B) before the loop body
C) after the loop body
D) as part of the loop conditional expression
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
61
When you know the number of times the statements must be executed,create a(n)____________ loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
62
The _____________ method of the MessageBox class displays a predefined dialog box that can contain text,captions for the title bar,special buttons,and icons.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
63
A(n)____________ is a loop that has no provisions for termination.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
64
An option other than looping that can be used to repeat program statement is _____________.With this technique a method calls itself repeatedly until it arrives at the solution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
65
The third programming construct repetition is also called ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
66
A sentinel value is a(n)____________.It is a value that should not be processed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
67
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
68
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;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
69
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 ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
70
____________ loops are often used for inputting data when you do not know the exact number of values to be entered.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
71
The ___________ loop structure,which restricts access to read-only,is used to iterate or move through a collection,such as an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
72
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
73
The only posttest loop structure available with C# is the ____________ loop structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
74
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
75
When one of the program statement included within the body of a loop is another loop,a(n)____________ loop is created.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.