Deck 5: Making Decisions

ملء الشاشة (f)
exit full mode
سؤال
The not equal (!=),and equal (==)symbols are overloaded operators.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
With a two-way if statement,either the true statement(s)is (are)executed or the false statement(s),or both.
سؤال
Equality comparisons with floating-point and decimal types often produce unpredictable results.
سؤال
The three basic programming constructs are simple sequence,selection,and iteration.
سؤال
The conditional expression true || false produces false.
سؤال
Relational operators allow you to test variables to see if one is greater or less than another variable or value.
سؤال
No fall through is permitted in C# if the previous case label has code.
سؤال
In C#,the && and || operators are also called the short-circuiting logical operators.
سؤال
The switch statement is considered a multiple selection structure and it also goes by the name case statement.
سؤال
The conditional expression,sometimes called "the test," must evaluate to true.
سؤال
When you have a single variable being tested for equality against four or more values,a one-way selection statement is the most appropriate type of conditional expression to use.
سؤال
Boolean variables store 0 to represent off or false and 1 to represent on or true.
سؤال
In C#,both the break and default are optional entries found with a switch statement.
سؤال
The <,>,<=,and >= are called the logical operators of the language.
سؤال
An exclamation point followed by a single equal symbol (!=)represents not equal in C#.
سؤال
The rule for lining up,or matching,elses is that the else is matched with the first if,from top to bottom.
سؤال
A comparison to determine whether the uppercase character S is less than the uppercase character W produces false.
سؤال
With an if statement,when you place a semicolon on the line that has the conditional expression,you create a null (empty)statement body for the true portion of the if statement.
سؤال
Conditional expressions produce a Boolean result.
سؤال
Two equal symbol characters == are used as the assignment operator.
سؤال
Using a single equal symbol inside a conditional expression,where a test was intended,causes a syntax error to be issued in C#.
سؤال
The short-circuiting logical operators ____.

A) enable doing as little as is needed to produce the final result
B) produce a boolean result of true
C) are performed before any other statements are executed
D) cause the program to stop execution when the expression is evaluated
سؤال
Assignment operators appear at the top of the hierarchy in the operator precedence table.
سؤال
The ternary operator ( ? : )provides another way to express a simple if...else selection statement.
سؤال
When you compare characters stored in char memory locations using relational operators,____.

A) they are compared lexicographically
B) you receive an error message
C) they are always considered equal
D) you get inconsistent results
سؤال
Class diagrams list the data field members in the center rectangle and the methods or behaviors in the bottom rectangle.
سؤال
The logical operators in C# are ____.

A) >, <, >=, <=
B) && and ||
C) != and ==
D) ==, =, and !=
سؤال
When strings are compared,the first character in the first operand is compared against the first character in the second operand.
سؤال
The expression,(5 > 57 % 8),evaluates to ____.

A) true
B) false
C) 1
D) 5 > 1
سؤال
Iteration,also called selection is used for decision making and allows your program statements to deviate from the sequential path and perform different statements based on the value of an expression.
سؤال
After completing the program,you should compare the results produced with the desk checked calculated results.
سؤال
Which of the following is NOT one of the basic programming constructs?

A) simple sequence
B) selection
C) iteration
D) event
سؤال
In the statement above,the entry inside the parentheses is called the ____.

A) conditional expression
B) truth value
C) selection construct
D) statement body
سؤال
String operands can be compared using the relational symbols.They are compared lexicographically using their Unicode character representation.
سؤال
The equality operator in C# is ____.

A) =
B) !=
C) ==
D).equals
سؤال
The assignment operators and the conditional operator ? : are right-associative.
سؤال
The result of the expression above is ____.

A) true or false
B) true
C) numeric
D) 100
سؤال
Selection statements must include a Boolean variable.
سؤال
____ perform differently based on their operands.

A) Overloaded operators
B) Conditional expressions
C) Boolean operators
D) Relational operators
سؤال
if (examScore > 89) grade = 'A';
The expression above is considered a(n)____.

A) iteration statement
B) two-way if statement
C) one-way if statement
D) simple sequence instruction
سؤال
Which of the following statements is NOT true regarding switch statements?

A) The expression is sometimes called the selector.
B) Default is only executed when there is no match.
C) Default is required.
D) A variable cannot be used as the case label.
سؤال
if (amount > 1000)
result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 14?

A) 1
B) 2
C) 3
D) 4
سؤال
When you place an if statement within another if statement,____.

A) a syntax error is generated
B) curly braces are required
C) you create a switch statement
D) you create a nested if statement
سؤال
The switch statement case value can evaluate to all of the following EXCEPT ____.

A) double
B) int
C) string
D) char
سؤال
When a single variable may need to be tested for five different values,the most readable solution would be a(n)____.

A) one-way if statement
B) two-way if statement
C) switch statement
D) nested if....else statement
سؤال
What is the rule for lining up,or matching,elses?

A) The first else goes with the first if.
B) Else goes with the closest previous if that does not have its own else.
C) The else goes with the one that is indented identically to it.
D) Else matches the closest if that follows it.
سؤال
Which of the following statements regarding curly braces is NOT correct as they relate to their use with an if statement?

A) They are required when there is more than one statement following the if or else.
B) They can be added to increase readability.
C) They are used to block three or more statements.
D) They can be used with the true statements and omitted with the false statements.
سؤال
if (a > 10)
if (b > 10)
if (c > 10)
result = 1;
else
if (b > 100)
result = 2;
else
result = 3;
else
result = 4;
else
result = 5;
What is stored in result when a is equal to zero,b and c are equal to 100?

A) 1
B) 3
C) 4
D) 5
سؤال
Placing a semicolon onto the end of the conditional one-way if statement ____.

A) causes the expression to evaluate to false
B) produces a syntax error
C) causes the expression to evaluate to true
D) produces a null empty bodied true statement
سؤال
if (examScore > 89); grade = 'A';
Using the code snippet above,when does grade get assigned a value of 'A'?

A) whenever the score is greater than 89
B) when the score is less than or equal to 89
C) never, a syntax error is generated
D) every time the program is run
سؤال
switch (phoneDigit)
{
case 1:
num = 1;
break;
case 2:
num = 2;
break;
case 3:
num = 3;
break;
case 4:
num = 4;
break;
default:
num = 0;
break;
}
Looking at the example above,what happens if the break is omitted?

A) a syntax error is generated
B) num is always assigned 0
C) num is never assigned a value
D) num is assigned 1
سؤال
if (amount > 1000)
result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 12000?

A) 1
B) 2
C) 3
D) 4
سؤال
switch (phoneDigit)
{
case 1:
num = 1;
break;
case 2:
num = 2;
break;
case 3:
num = 3;
break;
case 4:
num = 4;
break;
default:
num = 0;
break;
}
Looking at the example above,when phoneDigit has a value of 'Q',what value is stored in num?

A) 1
B) 0
C) Q
D) not enough information given
سؤال
if (aValue < largest ) result = aValue;
Else
Result = largest;
What happens when aValue is equal to largest in the program segment above?

A) result is assigned aValue
B) result is assigned largest
C) nothing, neither assignment statement is executed
D) an error is reported
سؤال
if (examScore > 89) grade = 'A';
Console.WriteLine("Excellent");
Using the code snippet above,when does Excellent get displayed?

A) whenever the score is greater than 89
B) when the score is less than or equal to 89
C) never, a syntax error is generated
D) every time the program is run
سؤال
if (a > 10)
if (b > 10)
if (c > 10)
result = 1;
else
if (b > 100)
result = 2;
else
result = 3;
else
result = 4;
else
result = 5;
What is stored in result when a,b and c are equal to 200?

A) 1
B) 2
C) 3
D) 4
سؤال
How can the compound conditional expression ((average > 79 && average <= 89))be written to eliminate the logical operator - without changing the logic?

A) remove the && and create a nested if statement
B) (average > 79 <= 89)
C) by replacing the && with ||
D) (79 > average <= 89)
سؤال
if (value1 > value2) largestOne = value1;
Else
If (value1 < value2)
LargestOne = value2;
Else
LargestOne = -(value1);
Using the nested if program statements,assuming value1 is 100 and value2 is 100,what is stored in largestOne above?

A) value1
B) value2
C) -(value1)
D) not enough information is given
سؤال
if (amount > 1000)
result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 876?

A) 1
B) 2
C) 3
D) 4
سؤال
A company issues $5,000.00 bonuses at the end of the year to all employees who earn less than $100,000.Salary and bonus are both defined as double data types.Which of the following selection statements would assign the correct amount to bonus?

A) if (salary < $100,000)
Bonus == $5000;
B) if (salary < 100000)
Bonus = 5000;
C) if (salary <= 100000)
Bonus = 5000;
D) if (salary < 100000);
Bonus = $5000;
سؤال
By properly ____________ the else clauses with their corresponding if clauses,you encounter fewer logic errors that necessitate debugging.
سؤال
The ____________ method will convert a string value sent as an argument to its equivalent numeric value,but it doesn't throw an exception when the conversion fails.
سؤال
Forms of the if statement include one-way,two-way,____________,multiway,and compound.
سؤال
____________ operators allow you to test variables to see if one is greater or less than
another variable or value.
سؤال
With a switch statement,if no match is made,the statements associated with ____________ are executed.
سؤال
A conditional expression is also referred to as a(n)____________.
سؤال
With ____________,as soon as the value of the entire expression is known,evaluation stops.
سؤال
C# does not allow a fall through and requires the ____________ statement for any case that has an executable statement.
سؤال
With the precedence rules or order of operations,____________ operators are always listed at the bottom of the hierarchy.
سؤال
The conditional operator,also called the ____________ provides another way to express a simple if...else selection statement.
سؤال
You cannot use the ____________ statement to test for a range of values.
سؤال
Conditional expressions produce a(n)____________ result.
سؤال
The equality operator in C# is represented by ____________.
سؤال
These categories are referred to as the basic programming constructs are simple sequence,iteration and ____________.
سؤال
The switch statement also goes by the name ____________.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 5: Making Decisions
1
The not equal (!=),and equal (==)symbols are overloaded operators.
True
2
With a two-way if statement,either the true statement(s)is (are)executed or the false statement(s),or both.
False
3
Equality comparisons with floating-point and decimal types often produce unpredictable results.
True
4
The three basic programming constructs are simple sequence,selection,and iteration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
5
The conditional expression true || false produces false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
6
Relational operators allow you to test variables to see if one is greater or less than another variable or value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
7
No fall through is permitted in C# if the previous case label has code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
8
In C#,the && and || operators are also called the short-circuiting logical operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
9
The switch statement is considered a multiple selection structure and it also goes by the name case statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
10
The conditional expression,sometimes called "the test," must evaluate to true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
11
When you have a single variable being tested for equality against four or more values,a one-way selection statement is the most appropriate type of conditional expression to use.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
12
Boolean variables store 0 to represent off or false and 1 to represent on or true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
13
In C#,both the break and default are optional entries found with a switch statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
14
The <,>,<=,and >= are called the logical operators of the language.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
15
An exclamation point followed by a single equal symbol (!=)represents not equal in C#.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
16
The rule for lining up,or matching,elses is that the else is matched with the first if,from top to bottom.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
17
A comparison to determine whether the uppercase character S is less than the uppercase character W produces false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
18
With an if statement,when you place a semicolon on the line that has the conditional expression,you create a null (empty)statement body for the true portion of the if statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
19
Conditional expressions produce a Boolean result.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
20
Two equal symbol characters == are used as the assignment operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
21
Using a single equal symbol inside a conditional expression,where a test was intended,causes a syntax error to be issued in C#.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
22
The short-circuiting logical operators ____.

A) enable doing as little as is needed to produce the final result
B) produce a boolean result of true
C) are performed before any other statements are executed
D) cause the program to stop execution when the expression is evaluated
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
23
Assignment operators appear at the top of the hierarchy in the operator precedence table.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
24
The ternary operator ( ? : )provides another way to express a simple if...else selection statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
25
When you compare characters stored in char memory locations using relational operators,____.

A) they are compared lexicographically
B) you receive an error message
C) they are always considered equal
D) you get inconsistent results
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
26
Class diagrams list the data field members in the center rectangle and the methods or behaviors in the bottom rectangle.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
27
The logical operators in C# are ____.

A) >, <, >=, <=
B) && and ||
C) != and ==
D) ==, =, and !=
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
28
When strings are compared,the first character in the first operand is compared against the first character in the second operand.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
29
The expression,(5 > 57 % 8),evaluates to ____.

A) true
B) false
C) 1
D) 5 > 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
30
Iteration,also called selection is used for decision making and allows your program statements to deviate from the sequential path and perform different statements based on the value of an expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
31
After completing the program,you should compare the results produced with the desk checked calculated results.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which of the following is NOT one of the basic programming constructs?

A) simple sequence
B) selection
C) iteration
D) event
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
33
In the statement above,the entry inside the parentheses is called the ____.

A) conditional expression
B) truth value
C) selection construct
D) statement body
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
34
String operands can be compared using the relational symbols.They are compared lexicographically using their Unicode character representation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
35
The equality operator in C# is ____.

A) =
B) !=
C) ==
D).equals
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
36
The assignment operators and the conditional operator ? : are right-associative.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
37
The result of the expression above is ____.

A) true or false
B) true
C) numeric
D) 100
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
38
Selection statements must include a Boolean variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
39
____ perform differently based on their operands.

A) Overloaded operators
B) Conditional expressions
C) Boolean operators
D) Relational operators
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
40
if (examScore > 89) grade = 'A';
The expression above is considered a(n)____.

A) iteration statement
B) two-way if statement
C) one-way if statement
D) simple sequence instruction
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
41
Which of the following statements is NOT true regarding switch statements?

A) The expression is sometimes called the selector.
B) Default is only executed when there is no match.
C) Default is required.
D) A variable cannot be used as the case label.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
42
if (amount > 1000)
result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 14?

A) 1
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
43
When you place an if statement within another if statement,____.

A) a syntax error is generated
B) curly braces are required
C) you create a switch statement
D) you create a nested if statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
44
The switch statement case value can evaluate to all of the following EXCEPT ____.

A) double
B) int
C) string
D) char
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
45
When a single variable may need to be tested for five different values,the most readable solution would be a(n)____.

A) one-way if statement
B) two-way if statement
C) switch statement
D) nested if....else statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
46
What is the rule for lining up,or matching,elses?

A) The first else goes with the first if.
B) Else goes with the closest previous if that does not have its own else.
C) The else goes with the one that is indented identically to it.
D) Else matches the closest if that follows it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
47
Which of the following statements regarding curly braces is NOT correct as they relate to their use with an if statement?

A) They are required when there is more than one statement following the if or else.
B) They can be added to increase readability.
C) They are used to block three or more statements.
D) They can be used with the true statements and omitted with the false statements.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
48
if (a > 10)
if (b > 10)
if (c > 10)
result = 1;
else
if (b > 100)
result = 2;
else
result = 3;
else
result = 4;
else
result = 5;
What is stored in result when a is equal to zero,b and c are equal to 100?

A) 1
B) 3
C) 4
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
49
Placing a semicolon onto the end of the conditional one-way if statement ____.

A) causes the expression to evaluate to false
B) produces a syntax error
C) causes the expression to evaluate to true
D) produces a null empty bodied true statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
50
if (examScore > 89); grade = 'A';
Using the code snippet above,when does grade get assigned a value of 'A'?

A) whenever the score is greater than 89
B) when the score is less than or equal to 89
C) never, a syntax error is generated
D) every time the program is run
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
51
switch (phoneDigit)
{
case 1:
num = 1;
break;
case 2:
num = 2;
break;
case 3:
num = 3;
break;
case 4:
num = 4;
break;
default:
num = 0;
break;
}
Looking at the example above,what happens if the break is omitted?

A) a syntax error is generated
B) num is always assigned 0
C) num is never assigned a value
D) num is assigned 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
52
if (amount > 1000)
result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 12000?

A) 1
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
53
switch (phoneDigit)
{
case 1:
num = 1;
break;
case 2:
num = 2;
break;
case 3:
num = 3;
break;
case 4:
num = 4;
break;
default:
num = 0;
break;
}
Looking at the example above,when phoneDigit has a value of 'Q',what value is stored in num?

A) 1
B) 0
C) Q
D) not enough information given
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
54
if (aValue < largest ) result = aValue;
Else
Result = largest;
What happens when aValue is equal to largest in the program segment above?

A) result is assigned aValue
B) result is assigned largest
C) nothing, neither assignment statement is executed
D) an error is reported
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
55
if (examScore > 89) grade = 'A';
Console.WriteLine("Excellent");
Using the code snippet above,when does Excellent get displayed?

A) whenever the score is greater than 89
B) when the score is less than or equal to 89
C) never, a syntax error is generated
D) every time the program is run
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
56
if (a > 10)
if (b > 10)
if (c > 10)
result = 1;
else
if (b > 100)
result = 2;
else
result = 3;
else
result = 4;
else
result = 5;
What is stored in result when a,b and c are equal to 200?

A) 1
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
57
How can the compound conditional expression ((average > 79 && average <= 89))be written to eliminate the logical operator - without changing the logic?

A) remove the && and create a nested if statement
B) (average > 79 <= 89)
C) by replacing the && with ||
D) (79 > average <= 89)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
58
if (value1 > value2) largestOne = value1;
Else
If (value1 < value2)
LargestOne = value2;
Else
LargestOne = -(value1);
Using the nested if program statements,assuming value1 is 100 and value2 is 100,what is stored in largestOne above?

A) value1
B) value2
C) -(value1)
D) not enough information is given
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
59
if (amount > 1000)
result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 876?

A) 1
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
60
A company issues $5,000.00 bonuses at the end of the year to all employees who earn less than $100,000.Salary and bonus are both defined as double data types.Which of the following selection statements would assign the correct amount to bonus?

A) if (salary < $100,000)
Bonus == $5000;
B) if (salary < 100000)
Bonus = 5000;
C) if (salary <= 100000)
Bonus = 5000;
D) if (salary < 100000);
Bonus = $5000;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
61
By properly ____________ the else clauses with their corresponding if clauses,you encounter fewer logic errors that necessitate debugging.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
62
The ____________ method will convert a string value sent as an argument to its equivalent numeric value,but it doesn't throw an exception when the conversion fails.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
63
Forms of the if statement include one-way,two-way,____________,multiway,and compound.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
64
____________ operators allow you to test variables to see if one is greater or less than
another variable or value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
65
With a switch statement,if no match is made,the statements associated with ____________ are executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
66
A conditional expression is also referred to as a(n)____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
67
With ____________,as soon as the value of the entire expression is known,evaluation stops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
68
C# does not allow a fall through and requires the ____________ statement for any case that has an executable statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
69
With the precedence rules or order of operations,____________ operators are always listed at the bottom of the hierarchy.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
70
The conditional operator,also called the ____________ provides another way to express a simple if...else selection statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
71
You cannot use the ____________ statement to test for a range of values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
72
Conditional expressions produce a(n)____________ result.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
73
The equality operator in C# is represented by ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
74
These categories are referred to as the basic programming constructs are simple sequence,iteration and ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
75
The switch statement also goes by the name ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.