Deck 5: Making Decisions in a Program

Full screen (f)
exit full mode
Question
A variable that has block scope can be used ____.

A) within the procedure in which it is declared
B) only within the statement block in which it is declared
C) within any statement blocks in the program
D) within any procedures in the program
Use Space or
up arrow
down arrow
to flip the card.
Question
In a dual-alternative selection structure, the word "else" to denote the beginning of the ____ path.

A) true
B) false
C) correct
D) wrong
Question
Variables declared within a statement block are referred to as ____ variables.

A) global
B) transient
C) block-level
D) internal
Question
String comparisons in Visual Basic are case-sensitive.
Question
In Visual Basic, ____ is the not equal to operator.

A) >>
B) >=
C)
D)
Question
You do not always need to include the ____ clause in an If ... Then ... Else statement.

A) If
B) Then
C) Else
D) End If
Question
You can divide by zero in Visual Basic with no problems.
Question
If intQuantity >= 10 Then      dblTotal = intQuantity * 2.5
Else
     dblTotal = intQuantity * 3.5
End If
The intQuantity variable contains the number 8 before the code above is processed. What value will be in the dblTotal variable after the code is processed?

A) 0
B) 20
C) 28
D) 35
Question
In a single-alternative selection structure, the tasks to perform when the condition is true are called the ____ path.

A) true
B) right
C) correct
D) specific
Question
The set of statements contained in each path of the If...Then...Else statement is referred to as a(n) ____.

A) statement clause
B) operator block
C) statement block
D) comparison clause
Question
You use the ____ operator to connect or link together strings.

A) addition
B) concatenation
C) append
D) combination
Question
Another term for a selection structure is a ____ structure.

A) sequential
B) decision
C) form
D) repetition
Question
Comparison operators are also referred to as ____ operators.

A) syntax
B) Boolean
C) arithmetic
D) relational
Question
You use the ____ method to convert a string to lowercase.

A) Lower
B) ConvertLower
C) ParseLower
D) ToLower
Question
The diamond in a flowchart is called the decision symbol, because it is used to represent the condition in both the selection and repetition structures.
Question
Visual Basic provides the ____ statement for coding single-alternative and dual-alternative selection structures.

A) If...Then...Else
B) Do...Loop
C) Begin..End
D) Select...Case
Question
You use the ____ method to convert a string to uppercase.

A) Upper
B) ConvertUpper
C) ParseUpper
D) ToUpper
Question
The condition in a selection structure must evaluate to either a True or False answer only.
Question
In Visual Basic, ____ is the greater than or equal to operator.

A) >>
B) >=
C)
D)
Question
Comparison operators have an order of precedence.
Question
What are the similarities and differences between variables declared at the beginning of a procedure and variables declared within a statement block?
Question
You create a Random object by declaring it in a(n) ____________________ statement.
Question
____________________ operators allow you to combine two or more conditions into one compound condition.
Question
What two methods does Visual Basic provide that you can use to solve the case problems that occur when comparing strings?
Question
When do you use a selection structure?
Question
Explain what happens when you use the OrElse operator.
Question
Explain what happens when you use the AndAlso operator.
Question
Programmers refer to the process of verifying that the input data is within the expected range as ____.

A) range checking
B) data verification
C) data validation
D) absolute programming
Question
Explain logical operators in terms of how they are used and evaluated within an expression. Provide an example of a logical operator.
Question
____________________ tables summarize how the computer evaluates the logical operators in an expression.
Question
What is a pseudo-random number generator?
Question
Describe the purpose of the text box CharacterCasing property.
Question
A(n) ______________________________ is a device that produces a sequence of numbers that are sufficiently random for practical purposes.
Question
Within a Visual Basic expression, logical operators are evaluated after any arithmetic or ____ operators in an expression.

A) comparison
B) string
C) open
D) closed
Question
The Pseudo-random number generator produces a sequence of numbers that are ____.

A) unlimited
B) not completely random
C) infinite
D) completely random
Question
How do you connect or link two strings together?
Question
Truth tables summarize how the computer evaluates the ____ operators in an expression.

A) integer
B) logical
C) arithmetic
D) string
Question
If the intAge variable contains the number 30 , the condition If intAge > 20 AndAlso intAge will evaluate to

A) True
B) False
C) Yes
D) No
Question
The ____________________ structure indicates that a decision (based on some condition) needs to be made before any further processing can occur.
Question
When you use the ____ operator to combine two sub-conditions, the resulting compound condition evaluates to True only when both sub-conditions are True .

A) And
B) Or
C) AndAlso
D) OrElse
Question
Match between columns
Requires a specific set of tasks to be performed only when the condition is true.
condition
Requires a specific set of tasks to be performed only when the condition is true.
<
Requires a specific set of tasks to be performed only when the condition is true.
&
Requires a specific set of tasks to be performed only when the condition is true.
>
Requires a specific set of tasks to be performed only when the condition is true.
OrElse
Requires a specific set of tasks to be performed only when the condition is true.
AndAlso
Requires a specific set of tasks to be performed only when the condition is true.
single-alternative selection structure
Requires a specific set of tasks to be performed only when the condition is true.
dual-alternative selection structure
Requires a specific set of tasks to be performed only when the condition is true.
ControlChars.NewLine constant
Advances the insertion point to the next line in a control.
condition
Advances the insertion point to the next line in a control.
<
Advances the insertion point to the next line in a control.
&
Advances the insertion point to the next line in a control.
>
Advances the insertion point to the next line in a control.
OrElse
Advances the insertion point to the next line in a control.
AndAlso
Advances the insertion point to the next line in a control.
single-alternative selection structure
Advances the insertion point to the next line in a control.
dual-alternative selection structure
Advances the insertion point to the next line in a control.
ControlChars.NewLine constant
The concatenation operator.
condition
The concatenation operator.
<
The concatenation operator.
&
The concatenation operator.
>
The concatenation operator.
OrElse
The concatenation operator.
AndAlso
The concatenation operator.
single-alternative selection structure
The concatenation operator.
dual-alternative selection structure
The concatenation operator.
ControlChars.NewLine constant
The greater than operator.
condition
The greater than operator.
<
The greater than operator.
&
The greater than operator.
>
The greater than operator.
OrElse
The greater than operator.
AndAlso
The greater than operator.
single-alternative selection structure
The greater than operator.
dual-alternative selection structure
The greater than operator.
ControlChars.NewLine constant
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
condition
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
<
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
&
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
>
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
OrElse
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
AndAlso
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
single-alternative selection structure
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
dual-alternative selection structure
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
ControlChars.NewLine constant
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
condition
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
<
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
&
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
>
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
OrElse
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
AndAlso
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
single-alternative selection structure
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
dual-alternative selection structure
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
ControlChars.NewLine constant
Specifies the decision you are making.
condition
Specifies the decision you are making.
<
Specifies the decision you are making.
&
Specifies the decision you are making.
>
Specifies the decision you are making.
OrElse
Specifies the decision you are making.
AndAlso
Specifies the decision you are making.
single-alternative selection structure
Specifies the decision you are making.
dual-alternative selection structure
Specifies the decision you are making.
ControlChars.NewLine constant
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
condition
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
<
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
&
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
>
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
OrElse
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
AndAlso
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
single-alternative selection structure
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
dual-alternative selection structure
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
ControlChars.NewLine constant
Question
How do you use the pseudo-random number generator in a procedure?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/42
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 5: Making Decisions in a Program
1
A variable that has block scope can be used ____.

A) within the procedure in which it is declared
B) only within the statement block in which it is declared
C) within any statement blocks in the program
D) within any procedures in the program
B
2
In a dual-alternative selection structure, the word "else" to denote the beginning of the ____ path.

A) true
B) false
C) correct
D) wrong
B
3
Variables declared within a statement block are referred to as ____ variables.

A) global
B) transient
C) block-level
D) internal
C
4
String comparisons in Visual Basic are case-sensitive.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
5
In Visual Basic, ____ is the not equal to operator.

A) >>
B) >=
C)
D)
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
6
You do not always need to include the ____ clause in an If ... Then ... Else statement.

A) If
B) Then
C) Else
D) End If
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
7
You can divide by zero in Visual Basic with no problems.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
8
If intQuantity >= 10 Then      dblTotal = intQuantity * 2.5
Else
     dblTotal = intQuantity * 3.5
End If
The intQuantity variable contains the number 8 before the code above is processed. What value will be in the dblTotal variable after the code is processed?

A) 0
B) 20
C) 28
D) 35
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
9
In a single-alternative selection structure, the tasks to perform when the condition is true are called the ____ path.

A) true
B) right
C) correct
D) specific
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
10
The set of statements contained in each path of the If...Then...Else statement is referred to as a(n) ____.

A) statement clause
B) operator block
C) statement block
D) comparison clause
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
11
You use the ____ operator to connect or link together strings.

A) addition
B) concatenation
C) append
D) combination
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
12
Another term for a selection structure is a ____ structure.

A) sequential
B) decision
C) form
D) repetition
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
13
Comparison operators are also referred to as ____ operators.

A) syntax
B) Boolean
C) arithmetic
D) relational
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
14
You use the ____ method to convert a string to lowercase.

A) Lower
B) ConvertLower
C) ParseLower
D) ToLower
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
15
The diamond in a flowchart is called the decision symbol, because it is used to represent the condition in both the selection and repetition structures.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
16
Visual Basic provides the ____ statement for coding single-alternative and dual-alternative selection structures.

A) If...Then...Else
B) Do...Loop
C) Begin..End
D) Select...Case
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
17
You use the ____ method to convert a string to uppercase.

A) Upper
B) ConvertUpper
C) ParseUpper
D) ToUpper
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
18
The condition in a selection structure must evaluate to either a True or False answer only.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
19
In Visual Basic, ____ is the greater than or equal to operator.

A) >>
B) >=
C)
D)
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
20
Comparison operators have an order of precedence.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
21
What are the similarities and differences between variables declared at the beginning of a procedure and variables declared within a statement block?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
22
You create a Random object by declaring it in a(n) ____________________ statement.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
23
____________________ operators allow you to combine two or more conditions into one compound condition.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
24
What two methods does Visual Basic provide that you can use to solve the case problems that occur when comparing strings?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
25
When do you use a selection structure?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
26
Explain what happens when you use the OrElse operator.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
27
Explain what happens when you use the AndAlso operator.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
28
Programmers refer to the process of verifying that the input data is within the expected range as ____.

A) range checking
B) data verification
C) data validation
D) absolute programming
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
29
Explain logical operators in terms of how they are used and evaluated within an expression. Provide an example of a logical operator.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
30
____________________ tables summarize how the computer evaluates the logical operators in an expression.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
31
What is a pseudo-random number generator?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
32
Describe the purpose of the text box CharacterCasing property.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
33
A(n) ______________________________ is a device that produces a sequence of numbers that are sufficiently random for practical purposes.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
34
Within a Visual Basic expression, logical operators are evaluated after any arithmetic or ____ operators in an expression.

A) comparison
B) string
C) open
D) closed
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
35
The Pseudo-random number generator produces a sequence of numbers that are ____.

A) unlimited
B) not completely random
C) infinite
D) completely random
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
36
How do you connect or link two strings together?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
37
Truth tables summarize how the computer evaluates the ____ operators in an expression.

A) integer
B) logical
C) arithmetic
D) string
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
38
If the intAge variable contains the number 30 , the condition If intAge > 20 AndAlso intAge will evaluate to

A) True
B) False
C) Yes
D) No
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
39
The ____________________ structure indicates that a decision (based on some condition) needs to be made before any further processing can occur.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
40
When you use the ____ operator to combine two sub-conditions, the resulting compound condition evaluates to True only when both sub-conditions are True .

A) And
B) Or
C) AndAlso
D) OrElse
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
Requires a specific set of tasks to be performed only when the condition is true.
condition
Requires a specific set of tasks to be performed only when the condition is true.
<
Requires a specific set of tasks to be performed only when the condition is true.
&
Requires a specific set of tasks to be performed only when the condition is true.
>
Requires a specific set of tasks to be performed only when the condition is true.
OrElse
Requires a specific set of tasks to be performed only when the condition is true.
AndAlso
Requires a specific set of tasks to be performed only when the condition is true.
single-alternative selection structure
Requires a specific set of tasks to be performed only when the condition is true.
dual-alternative selection structure
Requires a specific set of tasks to be performed only when the condition is true.
ControlChars.NewLine constant
Advances the insertion point to the next line in a control.
condition
Advances the insertion point to the next line in a control.
<
Advances the insertion point to the next line in a control.
&
Advances the insertion point to the next line in a control.
>
Advances the insertion point to the next line in a control.
OrElse
Advances the insertion point to the next line in a control.
AndAlso
Advances the insertion point to the next line in a control.
single-alternative selection structure
Advances the insertion point to the next line in a control.
dual-alternative selection structure
Advances the insertion point to the next line in a control.
ControlChars.NewLine constant
The concatenation operator.
condition
The concatenation operator.
<
The concatenation operator.
&
The concatenation operator.
>
The concatenation operator.
OrElse
The concatenation operator.
AndAlso
The concatenation operator.
single-alternative selection structure
The concatenation operator.
dual-alternative selection structure
The concatenation operator.
ControlChars.NewLine constant
The greater than operator.
condition
The greater than operator.
<
The greater than operator.
&
The greater than operator.
>
The greater than operator.
OrElse
The greater than operator.
AndAlso
The greater than operator.
single-alternative selection structure
The greater than operator.
dual-alternative selection structure
The greater than operator.
ControlChars.NewLine constant
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
condition
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
<
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
&
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
>
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
OrElse
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
AndAlso
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
single-alternative selection structure
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
dual-alternative selection structure
A logical operator where the compound condition evaluates to False only when both sub-conditions are False .
ControlChars.NewLine constant
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
condition
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
<
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
&
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
>
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
OrElse
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
AndAlso
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
single-alternative selection structure
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
dual-alternative selection structure
Contains two sets of instructions: one set is processed when the condition is true and the other set is processed when the condition is false.
ControlChars.NewLine constant
Specifies the decision you are making.
condition
Specifies the decision you are making.
<
Specifies the decision you are making.
&
Specifies the decision you are making.
>
Specifies the decision you are making.
OrElse
Specifies the decision you are making.
AndAlso
Specifies the decision you are making.
single-alternative selection structure
Specifies the decision you are making.
dual-alternative selection structure
Specifies the decision you are making.
ControlChars.NewLine constant
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
condition
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
<
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
&
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
>
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
OrElse
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
AndAlso
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
single-alternative selection structure
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
dual-alternative selection structure
The logical operator where the compound condition evaluates to True only when both sub-conditions are True .
ControlChars.NewLine constant
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
42
How do you use the pseudo-random number generator in a procedure?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 42 flashcards in this deck.