Deck 6: Control Statements: Part 2

ملء الشاشة (f)
exit full mode
سؤال
Which of the following is not a control statement in C#

A) do…while
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The for repetition statement handles the details of counter-controlled repeti
tion.
سؤال
Consider the following two C# code segments:
Segment 1 Segment 2
Int i = 0;
For (int i=0;i < = 20;++i)
While (i < 20) {
{ Console.WriteLine (i);
++i; }
Console.WriteLine (i);
}
Which of the following statements is true

A) The output from these segments is not the same.
B) The scope of the control variable i is different for the two segments.
C) Both (a) and (b) are true.
D) Neither (a) nor (b) is true.
سؤال
The first line of the for statement is sometimes called the:

A) for statement header
B) increment header
C) repetition header
D) None of the above.
سؤال
Which of the following for-loop control headers results in equivalent numbers of iterations:
1)for (int q = 1;q < = 100;++q)
2)for (int q = 100;q >= 0;--q)
3)for (int q = 99;q > 0;q -= 9)
4)for (int q = 990;q > 0;q -= 90)

A) 1) and 2)
B) 3) and 4)
C) 1) and 2) have equivalent iterations and 3 and 4 have equivalent iterations
D) None of the loops have equivalent iterations
سؤال
Modifying the control variable of a for statement in the body can cause errors.
سؤال
Which of the following for headers is syntactically incorrect

A) for (int i = 1; i < 10;)
B) for (; i == 3;)
C) for (i == 3)
D) None of the above.
سؤال
If a while condition is never true,the body will never execute.
سؤال
The header for (int i = 0;i < = 10;++i)will cause i to be incremented:

A) before the body begins execution
B) after the body begins to execute, but before it finishes
C) after the entire body executes
D) None of the above.
سؤال
Only one control variable may be initialized,incremented or decremented in a for statement header.
سؤال
A while statement automatically increments a variable that a programmer specifies.
سؤال
A common logic error known as a(n)occurs when the programmer incor
Rectly specifies a conditional operator,such as < instead of < =.

A) fatal error
B) off-by-one error
C) syntax error
D) None of the above.
سؤال
Counting loops should be controlled with whatever data type most closely reflects the operations taking place,whether that is an int,float or double.
سؤال
A variable used as a counter should be initialized when it's declared.
سؤال
Counting loops should be controlled with values.

A) double
B) int
C) char
D) None of the above.
سؤال
Counter-controlled repetition requires only a control variable,an initial value for the control variable and an increment or decrement.
سؤال
The initialization expression,condition and increment expression in a for statement's header must be separated with commas.
سؤال
A control variable that's declared in a for statement header is not accessible outside of the body of the for statement.
سؤال
for statements cannot be represented as while statements.
سؤال
Unary operators (such as ++)cannot be used in conditions.
سؤال
Which of the following statements is false

A) C# does not include an exponentiation operator.
B) The expression
Math.Pow(x, y)
Calculates the value of x raised to the yth power.
C) C# will implicitly convert a double to a decimal, or vice versa.
D) In loops, avoid calculations for which the result never changes-such calculations should typically be placed before the loop. Optimizing compilers will typically do this for you.
سؤال
Braces are normally included with do…while statements even when unnec
essary to avoid confusion with the while statement.
سؤال
The loop body of a do…while statement always executes __________.

A)zero times
B)at least once
C)more than once
D)undeterminable
سؤال
A default case must be provided for every switch statement.
سؤال
Some compilers will automatically remove from loops body statements that do not need to be executed multiple times through a process known as

A) classification
B) optimization
C) interpretation
D) None of the above.
سؤال
The C# operator ^ can be used for exponentiation.
سؤال
Which of the following is equivalent to this code segment
Segment: int total = 0;
For (int i = 0;i < = 20;i += 2)
{
Total += i;
}

A) int total = 0;
B) int total = 0;
C) int total = 0;
D) int total = 0;
سؤال
A case can be labeled as to execute in the event that none of the pro
Vided cases are equivalent to the controlling expression.

A) general
B) default
C) case *
D) None of the above.
سؤال
The do…while repetition statement tests the condition the body of the loop executes.

A) before
B) while
C) after
D) None of the above.
سؤال
What occurs when an empty case matches the controlling expression

A) fall through
B) syntax error
C) infinite loop
D) None of the above.
سؤال
A loop that counts down from 10 to 1 using control variable counter should use the loop-continuation condition counter < = 1.
سؤال
It's possible to specify that a constant is of type decimal by appending the letter m to the constant.
سؤال
A case that consists of multiple lines must be enclosed in braces.
سؤال
The initialization and increment expressions in a for statement can be comma-separated lists that enable you to use ________.

A) multiple initialization expressions
B) multiple increment expressions
C) multiple initialization expressions and/or multiple increment expressions
D) neither multiple initialization expressions nor multiple increment expressions
سؤال
Many classes provide methods to perform common tasks that do not require specific objects-they must be called using a class name.Such methods are called ________ methods.

A) classwide
B) dot (.)
C) console
D) static
سؤال
Which of the following statements is false

A) When a decimal variable is initialized to an int value, the int value must be cast to decimal.
B) C# treats whole-number literals like 7 and 1000 as type int.
C) Unlike double values, int values can be assigned to decimal variables.
D) C# treats numeric literals like 0.05 as type double.
سؤال
Compressing statements before and in a for statement into the for header can reduce the readability of a program
سؤال
Infinite loops are caused when the loop-continuation condition in a while,for or do…while statement never becomes true.
سؤال
What is the Windows key sequence for typing the end-of-file indicator in Command Prompt window

A) < Alt > z
B) < Ctrl > z
C) < Windows >z
D) < Shift >z
سؤال
Which of the following will count down from 10 to 1 correctly

A) for (int j = 10; j < = 1; ++j)
B) for (int j = 1; j < = 10; ++j)
C) for (int j = 10; j > 1; --j)
D) for (int j = 10; j >= 1; --j)
سؤال
Only the statements for one case can be executed in any one execution of a switch statement.
سؤال
The continue statement is used to undo the effects of the break statement.
سؤال
A case with no statements is called an empty case,and requires only the break statement.
سؤال
The statement,when executed in a while loop,skips the remaining statements in the body of the statement and begins the next iteration of the loop.

A) continue
B) break
C) next
D) None of the above.
سؤال
The statement,when executed in a for loop,will terminate the loop.

A) continue
B) break
C) next
D) None of the above.
سؤال
The logical exclusive OR operator is true if it at least one of its operands is true.
سؤال
The break statement terminates a program.
سؤال
The second operand of an && operator will not be evaluated if the first operand evaluates to true.
سؤال
The effects of break and continue statements can be achieved by struc
tured programming techniques.
سؤال
The && operator has higher precedence than the || operator.
سؤال
Which is equivalent to if (!(grade == sentinelValue))

A) if (grade !== sentinelValue)
B)if (grade != sentinelValue)
C) if (grade == sentinelValue)
D) if (grade !== sentinelValue)
سؤال
Which of the following operators ensures that at least one out of multiple conditions is true

A) ||
B) &&
C) ==
D) ^
سؤال
Suppose variable gender is MALE and age equals 60,how is the expression
(gender == FEMALE)&& (age >= 65)
Evaluated

A) The condition (gender == FEMALE) is evaluated first and the evaluation stops immediately.
B) The condition (age >= 65) is evaluated first and the evaluation stops immediately.
C) Both conditions are evaluated, from left to right.
D) Both conditions are evaluated, from right to left.
سؤال
Which case of the following would warrant using the boolean logical inclusive OR (|)rather than the conditional OR (||)

A) Testing if two conditions are both true.
B) Testing if at least one of two conditions is true.
C) Testing if at least one of two conditions is true when the right operand has a required side effect.
D) Testing if at least one of two conditions is true when the left operand has a required side effect.
سؤال
Which of the following statements about the break statement is false

A) The break statement is used to exit a repetition statement early and continue execution after the loop.
B) A break statement can only break out of an immediately enclosing while, for, do…while or switch statement.
C) The break statement, when executed in a while, for or do…while, skips the remaining statements in the loop body and proceeds with the next iteration of the loop.
D) Common uses of the break statement are to escape early from a loop or to skip the remainder of a switch.
سؤال
Assuming a is a bool with a value of false,which of the following eval
Uates to true

A) !(!a)
B) a
C) !a
D) None of the above.
سؤال
Short-circuit evaluation is a performance feature related to the evaluation of conditional AND and conditional OR expressions.
سؤال
Which of the following statements about the continue statement is true

A) The continue statement is used to exit a repetition statement early and continue execution after the loop.
B) The continue statement is used to continue after a switch statement.
C) The continue statement does not alter the flow of control.
D) A continue statement proceeds with the next iteration of the immediately enclosing while, for, do…while statement.
سؤال
Consider the code segment below.
If (gender == 1)
{
If (age >= 65)
{
++seniorFemales;
}
}
This segment is equivalent to which of the following

A) if (gender == 1 || age >= 65) {
B) if (gender == 1 && age >= 65)
C) if (gender == 1 AND age >= 65)
D) if (gender == 1 OR age >= 65)
سؤال
Which of the following statements is true

A) strings can be used in switch expressions, but string literals cannot be used in case labels.
B) strings cannot be used in switch expressions, but string literals can be used in case labels.
C) strings can be used in switch expressions, and string literals can be used in case labels.
D) strings cannot be used in switch expressions, and string literals cannot be used in case labels.
سؤال
In structured programming,the only two ways to combine control statements are stacking and nesting.
سؤال
The rule says that any rectangle (action)in an activity diagram can be replaced by two rectangles with round edges.

A) nesting
B) selection
C) stacking
D) None of the above.
سؤال
The while statement is sufficient to perform any type of repetition.
سؤال
The stacking and nesting rules must be applied in a specific order.
سؤال
Which statement below is false

A)Structured programming produces programs that are easier to test.
B)Structured programming requires four forms of control.
C)Structured programming produces programs that are easier to modify
D)Structured programming promotes simplicity.
سؤال
Control-statement stacking is the process of:

A) placing control statements within each other
B) placing control statements one after another
C) reducing the number of statements required by combining statements
D) None of the above.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/66
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Control Statements: Part 2
1
Which of the following is not a control statement in C#

A) do…while
B
Essentials of Counter-Controlled Repetition
2
The for repetition statement handles the details of counter-controlled repeti
tion.
True
3
Consider the following two C# code segments:
Segment 1 Segment 2
Int i = 0;
For (int i=0;i < = 20;++i)
While (i < 20) {
{ Console.WriteLine (i);
++i; }
Console.WriteLine (i);
}
Which of the following statements is true

A) The output from these segments is not the same.
B) The scope of the control variable i is different for the two segments.
C) Both (a) and (b) are true.
D) Neither (a) nor (b) is true.
C
4
The first line of the for statement is sometimes called the:

A) for statement header
B) increment header
C) repetition header
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following for-loop control headers results in equivalent numbers of iterations:
1)for (int q = 1;q < = 100;++q)
2)for (int q = 100;q >= 0;--q)
3)for (int q = 99;q > 0;q -= 9)
4)for (int q = 990;q > 0;q -= 90)

A) 1) and 2)
B) 3) and 4)
C) 1) and 2) have equivalent iterations and 3 and 4 have equivalent iterations
D) None of the loops have equivalent iterations
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
6
Modifying the control variable of a for statement in the body can cause errors.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following for headers is syntactically incorrect

A) for (int i = 1; i < 10;)
B) for (; i == 3;)
C) for (i == 3)
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
8
If a while condition is never true,the body will never execute.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
9
The header for (int i = 0;i < = 10;++i)will cause i to be incremented:

A) before the body begins execution
B) after the body begins to execute, but before it finishes
C) after the entire body executes
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
10
Only one control variable may be initialized,incremented or decremented in a for statement header.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
11
A while statement automatically increments a variable that a programmer specifies.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
12
A common logic error known as a(n)occurs when the programmer incor
Rectly specifies a conditional operator,such as < instead of < =.

A) fatal error
B) off-by-one error
C) syntax error
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
13
Counting loops should be controlled with whatever data type most closely reflects the operations taking place,whether that is an int,float or double.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
14
A variable used as a counter should be initialized when it's declared.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
15
Counting loops should be controlled with values.

A) double
B) int
C) char
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
16
Counter-controlled repetition requires only a control variable,an initial value for the control variable and an increment or decrement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
17
The initialization expression,condition and increment expression in a for statement's header must be separated with commas.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
18
A control variable that's declared in a for statement header is not accessible outside of the body of the for statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
19
for statements cannot be represented as while statements.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
20
Unary operators (such as ++)cannot be used in conditions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following statements is false

A) C# does not include an exponentiation operator.
B) The expression
Math.Pow(x, y)
Calculates the value of x raised to the yth power.
C) C# will implicitly convert a double to a decimal, or vice versa.
D) In loops, avoid calculations for which the result never changes-such calculations should typically be placed before the loop. Optimizing compilers will typically do this for you.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
22
Braces are normally included with do…while statements even when unnec
essary to avoid confusion with the while statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
23
The loop body of a do…while statement always executes __________.

A)zero times
B)at least once
C)more than once
D)undeterminable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
24
A default case must be provided for every switch statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
25
Some compilers will automatically remove from loops body statements that do not need to be executed multiple times through a process known as

A) classification
B) optimization
C) interpretation
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
26
The C# operator ^ can be used for exponentiation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following is equivalent to this code segment
Segment: int total = 0;
For (int i = 0;i < = 20;i += 2)
{
Total += i;
}

A) int total = 0;
B) int total = 0;
C) int total = 0;
D) int total = 0;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
28
A case can be labeled as to execute in the event that none of the pro
Vided cases are equivalent to the controlling expression.

A) general
B) default
C) case *
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
29
The do…while repetition statement tests the condition the body of the loop executes.

A) before
B) while
C) after
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
30
What occurs when an empty case matches the controlling expression

A) fall through
B) syntax error
C) infinite loop
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
31
A loop that counts down from 10 to 1 using control variable counter should use the loop-continuation condition counter < = 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
32
It's possible to specify that a constant is of type decimal by appending the letter m to the constant.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
33
A case that consists of multiple lines must be enclosed in braces.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
34
The initialization and increment expressions in a for statement can be comma-separated lists that enable you to use ________.

A) multiple initialization expressions
B) multiple increment expressions
C) multiple initialization expressions and/or multiple increment expressions
D) neither multiple initialization expressions nor multiple increment expressions
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
35
Many classes provide methods to perform common tasks that do not require specific objects-they must be called using a class name.Such methods are called ________ methods.

A) classwide
B) dot (.)
C) console
D) static
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
36
Which of the following statements is false

A) When a decimal variable is initialized to an int value, the int value must be cast to decimal.
B) C# treats whole-number literals like 7 and 1000 as type int.
C) Unlike double values, int values can be assigned to decimal variables.
D) C# treats numeric literals like 0.05 as type double.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
37
Compressing statements before and in a for statement into the for header can reduce the readability of a program
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
38
Infinite loops are caused when the loop-continuation condition in a while,for or do…while statement never becomes true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
39
What is the Windows key sequence for typing the end-of-file indicator in Command Prompt window

A) < Alt > z
B) < Ctrl > z
C) < Windows >z
D) < Shift >z
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
40
Which of the following will count down from 10 to 1 correctly

A) for (int j = 10; j < = 1; ++j)
B) for (int j = 1; j < = 10; ++j)
C) for (int j = 10; j > 1; --j)
D) for (int j = 10; j >= 1; --j)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
41
Only the statements for one case can be executed in any one execution of a switch statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
42
The continue statement is used to undo the effects of the break statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
43
A case with no statements is called an empty case,and requires only the break statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
44
The statement,when executed in a while loop,skips the remaining statements in the body of the statement and begins the next iteration of the loop.

A) continue
B) break
C) next
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
45
The statement,when executed in a for loop,will terminate the loop.

A) continue
B) break
C) next
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
46
The logical exclusive OR operator is true if it at least one of its operands is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
47
The break statement terminates a program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
48
The second operand of an && operator will not be evaluated if the first operand evaluates to true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
49
The effects of break and continue statements can be achieved by struc
tured programming techniques.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
50
The && operator has higher precedence than the || operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
51
Which is equivalent to if (!(grade == sentinelValue))

A) if (grade !== sentinelValue)
B)if (grade != sentinelValue)
C) if (grade == sentinelValue)
D) if (grade !== sentinelValue)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
52
Which of the following operators ensures that at least one out of multiple conditions is true

A) ||
B) &&
C) ==
D) ^
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
53
Suppose variable gender is MALE and age equals 60,how is the expression
(gender == FEMALE)&& (age >= 65)
Evaluated

A) The condition (gender == FEMALE) is evaluated first and the evaluation stops immediately.
B) The condition (age >= 65) is evaluated first and the evaluation stops immediately.
C) Both conditions are evaluated, from left to right.
D) Both conditions are evaluated, from right to left.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
54
Which case of the following would warrant using the boolean logical inclusive OR (|)rather than the conditional OR (||)

A) Testing if two conditions are both true.
B) Testing if at least one of two conditions is true.
C) Testing if at least one of two conditions is true when the right operand has a required side effect.
D) Testing if at least one of two conditions is true when the left operand has a required side effect.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
55
Which of the following statements about the break statement is false

A) The break statement is used to exit a repetition statement early and continue execution after the loop.
B) A break statement can only break out of an immediately enclosing while, for, do…while or switch statement.
C) The break statement, when executed in a while, for or do…while, skips the remaining statements in the loop body and proceeds with the next iteration of the loop.
D) Common uses of the break statement are to escape early from a loop or to skip the remainder of a switch.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
56
Assuming a is a bool with a value of false,which of the following eval
Uates to true

A) !(!a)
B) a
C) !a
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
57
Short-circuit evaluation is a performance feature related to the evaluation of conditional AND and conditional OR expressions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
58
Which of the following statements about the continue statement is true

A) The continue statement is used to exit a repetition statement early and continue execution after the loop.
B) The continue statement is used to continue after a switch statement.
C) The continue statement does not alter the flow of control.
D) A continue statement proceeds with the next iteration of the immediately enclosing while, for, do…while statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
59
Consider the code segment below.
If (gender == 1)
{
If (age >= 65)
{
++seniorFemales;
}
}
This segment is equivalent to which of the following

A) if (gender == 1 || age >= 65) {
B) if (gender == 1 && age >= 65)
C) if (gender == 1 AND age >= 65)
D) if (gender == 1 OR age >= 65)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
60
Which of the following statements is true

A) strings can be used in switch expressions, but string literals cannot be used in case labels.
B) strings cannot be used in switch expressions, but string literals can be used in case labels.
C) strings can be used in switch expressions, and string literals can be used in case labels.
D) strings cannot be used in switch expressions, and string literals cannot be used in case labels.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
61
In structured programming,the only two ways to combine control statements are stacking and nesting.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
62
The rule says that any rectangle (action)in an activity diagram can be replaced by two rectangles with round edges.

A) nesting
B) selection
C) stacking
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
63
The while statement is sufficient to perform any type of repetition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
64
The stacking and nesting rules must be applied in a specific order.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
65
Which statement below is false

A)Structured programming produces programs that are easier to test.
B)Structured programming requires four forms of control.
C)Structured programming produces programs that are easier to modify
D)Structured programming promotes simplicity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
66
Control-statement stacking is the process of:

A) placing control statements within each other
B) placing control statements one after another
C) reducing the number of statements required by combining statements
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 66 في هذه المجموعة.