Deck 4: Decisions and Conditions

ملء الشاشة (f)
exit full mode
سؤال
When a program executes a Call statement and the called procedure completes executing its code,program execution resumes on the statement following the call.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Or and And are logical operators used in compound expressions.
سؤال
When using Select Case,the group of statements must end with End Case.
سؤال
In an If / Then / Else statement,the Else clause is optional.
سؤال
The AND operator requires that both conditions be True for the compound expression to be True.
سؤال
It's a good idea to always use the ToUpper or ToLower method on the Text property of text boxes,whenever comparing string values.
سؤال
In an If statement,when the expression is false,only the Else clause,if present,is executed.
سؤال
The Unified Modeling Language (UML)can be used to nest If statements in code.
سؤال
A block of If / Then / Else must begin with an If statement and end with an EndOfIf statement.
سؤال
The code: If NumberAInteger > NumberBInteger OR NumberBInteger > NumberCInteger Then,evaluates True when NumberAInteger = 3,NumberBInteger = 5,and NumberCInteger = 2.
سؤال
Event procedures may be called from any procedure within the form.
سؤال
The code: If NumberAInteger > NumberBInteger AND NumberBInteger > NumberCInteger Then,evaluates True when NumberAInteger = 3,NumberBInteger = 5,and NumberCInteger = 2.
سؤال
When a CheckBox is checked,the Checked property will return a value of True.
سؤال
A CheckBox may be tested to determine if it is checked by using the following code:
If TestChecked.Checked Then
سؤال
If statements containing additional Ifs are said to be nested If statements.
سؤال
Usually,the code written for a Case structure is simpler and easier to read than if the same code was written with nested Ifs.
سؤال
The code: If NumAInteger <> NumBInteger Then,evaluates True when NumAInteger = 3 and NumBInteger = 5.
سؤال
Each ELSE will be matched with the last unmatched IF,regardless of indentation.
سؤال
"If RedRadioButton.Checked Then" is valid code for checking if a radio button is selected.
سؤال
AndAlso is a logical operator that will "short-circuit" if the first expression is False.
سؤال
Nested Ifs are allowed,_______.

A)But you are limited to only 4 levels of Ifs
B)But each If must have an End If
C)Can be difficult to follow if they are nested too deeply
D)Both answers b and c are correct.
سؤال
When comparing strings,which one of the following strings is less than the others,based on the ANSI code?

A)ONETWOTHREE
B)onetwothree
C)OneTwoThree
D)1Two3
سؤال
Which of the following is NOT a logical operator?

A)If
B)Or
C)And
D)Not
سؤال
With the logical operator _______,if the first expression is True,the second expression will not be evaluated.

A)And
B)Or
C)AndAlso
D)OrElse
سؤال
A line of code that is marked as a breakpoint will have a large red dot in the left margin and the code will be highlighted in red.
سؤال
In an If statement,when the expression is true,_______.

A)Only the Else clause is executed
B)Only the ElseIf clause is executed
C)Only the End If statement is executed
D)Only the Then clause is executed
سؤال
With the logical operator _______,both expressions must be true for the entire expression to evaluate True.

A)And
B)Or
C)AndAlso
D)OrElse
سؤال
Which of the following is a comparison operator?

A)And
B)>
C)+
D)&
سؤال
The Show method of a MessageBox returns a _______ object that you can check to see which button the user clicked.

A)Show
B)ShowMe
C)Selected
D)DialogResult
سؤال
It is not necessary to use the Call keyword when you want to call another event procedure.Simply list the object name,an underscore,the event,and the parentheses.If the procedure that you are calling requires arguments,place the arguments within the parentheses.
سؤال
An If contained within another If statement is _______.

A)A nested If
B)A compound expression
C)An embedded contradiction
D)Impossible to do in VB
سؤال
Once a Visual Basic event procedure is executing,there is no way of stopping execution before an error causes it to stop.
سؤال
Which of the following is correct code for determining if a checkbox is checked?

A)If Senior.Checkbox = True Then
B)If SeniorCheckBox.Checked = True Then
C)If SeniorCheckBox.Checked Then
D)Both answers B and C are correct.
سؤال
To set a breakpoint,place the mouse pointer in the gray margin indicator area at the left edge of the Editor window and click.
سؤال
Which of the following statements does NOT apply to the Case structure?

A)It can be used instead of nested Ifs.
B)It can be used for testing numeric and string values.
C)It must begin with Select Case and it must end with End Case.
D)Case Else is optional.
سؤال
When a project is running and it reaches a breakpoint in the code,the program will halt,display the line with the breakpoint and go into debug time.
سؤال
______________ will be the result of: MessageText.Text = MessageText.Text.ToUpper()when the value of MessageText.Text is "Visual Basic is fun!".

A)Visual Basic is fun!
B)VISUAL BASIC IS FUN!
C)visual basic is fun!
D)VisualBasicisfun!
سؤال
What will display in MessageLabel when the following statements are executed? Assume that CountInteger = 10. MessageString = "Visual Basic is fun"
IF CountInteger <= 10 Then
MessageLabel.Text = MessageString.ToLower()
ELSEIF CountInteger > 20 Then
MessageLabel.Text = MessageString.ToUpper()
ELSE
MessageLabel.Text = MessageString
END IF

A)VISUAL BASIC IS FUN
B)Visual Basic Is Fun
C)visual basic is fun
D)syntax error
سؤال
Use the Visual Studio intrinsic constant,_______,to determine line endings.

A)VB.Multiline
B)Environment.NewLine
C)VS.NewLine
D)VB.NewLine
سؤال
Checking to verify that appropriate values have been entered for a text box is called _______.

A)verification
B)validation
C)a MessageBox
D)a watch expression
سؤال
What are the six comparison operators? Give an example using each one.
(Student's answers may vary. )
Operator Example
> CorrectInteger > 75
< NameText.Text.ToUpper()< NameString.ToUpper()
= PasswordText.Text.ToUpper()= "SECRET"
<> GraduateRadioButton.Checked <> True
>= PriceDecimal >= PriceTotalDecimal
<= GradeDecimal <= TotalGradeDecimal
سؤال
Use the Case structure and convert the following If statement so that it checks the string as an uppercase value.
If StateNameString = "California" Then
AdjustedPriceDecimal = PriceDecimal+(PriceDecimal * TaxDecimal)
Else
AdjustedPriceDecimal = PriceDecimal
End If
سؤال
You can write a set of instructions in an event procedure and then ________ the event procedure from any other procedure.

A)declare the variables in
B)force a break in
C)use Option Explicit in
D)call
سؤال
The Select Case statement must end with __________.

A)End Select
B)End Case
C)Select End
D)Case End
سؤال
What is the value of MysteryInteger when the following statements are executed? Const NUMBER_Integer As Integer = 10
Select Case NUMBER_Integer
Case 1,3,5,7,9
MysteryInteger = NUMBER_Integer
Case 2,4,6,8,10
MysteryInteger = NUMBER_Integer + 1 * 2
Case Else
MysteryInteger = NUMBER_Integer * 2 + 1
End Select

A)10
B)12
C)21
D)22
سؤال
The _______ displays all objects and variables that are within scope during a break in program execution.

A)Locals window
B)Procedure Box
C)Autos window
D)Step Into
سؤال
_______ is an optional clause available for the Case Structure when no match is found in any of the Case statements.

A)Case Else
B)Default
C)ElseIf
D)Else Case
سؤال
The Select Case statement is a code structure used for ________.

A)repetition
B)selection
C)sequence
D)none of these
سؤال
The Debug.WriteLine method will display its results in the ________ window.

A)Debug
B)Immediate
C)WriteLine
D)Breakpoint
سؤال
You can use _______________ as your project executes in order to view the values of variables and control contents that are referenced in the current statement and a few statements on either side of the current statement.

A)the Locals window
B)the Procedure Box
C)the Autos window
D)Step Into
سؤال
When you share an event procedure with radio buttons,Visual Basic creates and passes a system variable object named,_______,which has a name property containing the name of the selected button.

A)sender
B)integer
C)source
D)number
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/51
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 4: Decisions and Conditions
1
When a program executes a Call statement and the called procedure completes executing its code,program execution resumes on the statement following the call.
True
2
Or and And are logical operators used in compound expressions.
True
3
When using Select Case,the group of statements must end with End Case.
False
4
In an If / Then / Else statement,the Else clause is optional.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
5
The AND operator requires that both conditions be True for the compound expression to be True.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
6
It's a good idea to always use the ToUpper or ToLower method on the Text property of text boxes,whenever comparing string values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
7
In an If statement,when the expression is false,only the Else clause,if present,is executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
8
The Unified Modeling Language (UML)can be used to nest If statements in code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
9
A block of If / Then / Else must begin with an If statement and end with an EndOfIf statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
10
The code: If NumberAInteger > NumberBInteger OR NumberBInteger > NumberCInteger Then,evaluates True when NumberAInteger = 3,NumberBInteger = 5,and NumberCInteger = 2.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
11
Event procedures may be called from any procedure within the form.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
12
The code: If NumberAInteger > NumberBInteger AND NumberBInteger > NumberCInteger Then,evaluates True when NumberAInteger = 3,NumberBInteger = 5,and NumberCInteger = 2.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
13
When a CheckBox is checked,the Checked property will return a value of True.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
14
A CheckBox may be tested to determine if it is checked by using the following code:
If TestChecked.Checked Then
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
15
If statements containing additional Ifs are said to be nested If statements.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
16
Usually,the code written for a Case structure is simpler and easier to read than if the same code was written with nested Ifs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
17
The code: If NumAInteger <> NumBInteger Then,evaluates True when NumAInteger = 3 and NumBInteger = 5.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
18
Each ELSE will be matched with the last unmatched IF,regardless of indentation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
19
"If RedRadioButton.Checked Then" is valid code for checking if a radio button is selected.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
20
AndAlso is a logical operator that will "short-circuit" if the first expression is False.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
21
Nested Ifs are allowed,_______.

A)But you are limited to only 4 levels of Ifs
B)But each If must have an End If
C)Can be difficult to follow if they are nested too deeply
D)Both answers b and c are correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
22
When comparing strings,which one of the following strings is less than the others,based on the ANSI code?

A)ONETWOTHREE
B)onetwothree
C)OneTwoThree
D)1Two3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following is NOT a logical operator?

A)If
B)Or
C)And
D)Not
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
24
With the logical operator _______,if the first expression is True,the second expression will not be evaluated.

A)And
B)Or
C)AndAlso
D)OrElse
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
25
A line of code that is marked as a breakpoint will have a large red dot in the left margin and the code will be highlighted in red.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
26
In an If statement,when the expression is true,_______.

A)Only the Else clause is executed
B)Only the ElseIf clause is executed
C)Only the End If statement is executed
D)Only the Then clause is executed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
27
With the logical operator _______,both expressions must be true for the entire expression to evaluate True.

A)And
B)Or
C)AndAlso
D)OrElse
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which of the following is a comparison operator?

A)And
B)>
C)+
D)&
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
29
The Show method of a MessageBox returns a _______ object that you can check to see which button the user clicked.

A)Show
B)ShowMe
C)Selected
D)DialogResult
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
30
It is not necessary to use the Call keyword when you want to call another event procedure.Simply list the object name,an underscore,the event,and the parentheses.If the procedure that you are calling requires arguments,place the arguments within the parentheses.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
31
An If contained within another If statement is _______.

A)A nested If
B)A compound expression
C)An embedded contradiction
D)Impossible to do in VB
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
32
Once a Visual Basic event procedure is executing,there is no way of stopping execution before an error causes it to stop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
33
Which of the following is correct code for determining if a checkbox is checked?

A)If Senior.Checkbox = True Then
B)If SeniorCheckBox.Checked = True Then
C)If SeniorCheckBox.Checked Then
D)Both answers B and C are correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
34
To set a breakpoint,place the mouse pointer in the gray margin indicator area at the left edge of the Editor window and click.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following statements does NOT apply to the Case structure?

A)It can be used instead of nested Ifs.
B)It can be used for testing numeric and string values.
C)It must begin with Select Case and it must end with End Case.
D)Case Else is optional.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
36
When a project is running and it reaches a breakpoint in the code,the program will halt,display the line with the breakpoint and go into debug time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
37
______________ will be the result of: MessageText.Text = MessageText.Text.ToUpper()when the value of MessageText.Text is "Visual Basic is fun!".

A)Visual Basic is fun!
B)VISUAL BASIC IS FUN!
C)visual basic is fun!
D)VisualBasicisfun!
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
38
What will display in MessageLabel when the following statements are executed? Assume that CountInteger = 10. MessageString = "Visual Basic is fun"
IF CountInteger <= 10 Then
MessageLabel.Text = MessageString.ToLower()
ELSEIF CountInteger > 20 Then
MessageLabel.Text = MessageString.ToUpper()
ELSE
MessageLabel.Text = MessageString
END IF

A)VISUAL BASIC IS FUN
B)Visual Basic Is Fun
C)visual basic is fun
D)syntax error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
39
Use the Visual Studio intrinsic constant,_______,to determine line endings.

A)VB.Multiline
B)Environment.NewLine
C)VS.NewLine
D)VB.NewLine
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
40
Checking to verify that appropriate values have been entered for a text box is called _______.

A)verification
B)validation
C)a MessageBox
D)a watch expression
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
41
What are the six comparison operators? Give an example using each one.
(Student's answers may vary. )
Operator Example
> CorrectInteger > 75
< NameText.Text.ToUpper()< NameString.ToUpper()
= PasswordText.Text.ToUpper()= "SECRET"
<> GraduateRadioButton.Checked <> True
>= PriceDecimal >= PriceTotalDecimal
<= GradeDecimal <= TotalGradeDecimal
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
42
Use the Case structure and convert the following If statement so that it checks the string as an uppercase value.
If StateNameString = "California" Then
AdjustedPriceDecimal = PriceDecimal+(PriceDecimal * TaxDecimal)
Else
AdjustedPriceDecimal = PriceDecimal
End If
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
43
You can write a set of instructions in an event procedure and then ________ the event procedure from any other procedure.

A)declare the variables in
B)force a break in
C)use Option Explicit in
D)call
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
44
The Select Case statement must end with __________.

A)End Select
B)End Case
C)Select End
D)Case End
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
45
What is the value of MysteryInteger when the following statements are executed? Const NUMBER_Integer As Integer = 10
Select Case NUMBER_Integer
Case 1,3,5,7,9
MysteryInteger = NUMBER_Integer
Case 2,4,6,8,10
MysteryInteger = NUMBER_Integer + 1 * 2
Case Else
MysteryInteger = NUMBER_Integer * 2 + 1
End Select

A)10
B)12
C)21
D)22
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
46
The _______ displays all objects and variables that are within scope during a break in program execution.

A)Locals window
B)Procedure Box
C)Autos window
D)Step Into
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
47
_______ is an optional clause available for the Case Structure when no match is found in any of the Case statements.

A)Case Else
B)Default
C)ElseIf
D)Else Case
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
48
The Select Case statement is a code structure used for ________.

A)repetition
B)selection
C)sequence
D)none of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
49
The Debug.WriteLine method will display its results in the ________ window.

A)Debug
B)Immediate
C)WriteLine
D)Breakpoint
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
50
You can use _______________ as your project executes in order to view the values of variables and control contents that are referenced in the current statement and a few statements on either side of the current statement.

A)the Locals window
B)the Procedure Box
C)the Autos window
D)Step Into
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
51
When you share an event procedure with radio buttons,Visual Basic creates and passes a system variable object named,_______,which has a name property containing the name of the selected button.

A)sender
B)integer
C)source
D)number
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.