Deck 4: Making Decisions in a Program
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
Play
Full screen (f)
Deck 4: Making Decisions in a Program
1
You use the ____ operator to connect or link together strings.
A) addition
B) concatenation
C) append
D) combination
A) addition
B) concatenation
C) append
D) combination
B
2
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.
True
3
Comparison operators have an order of precedence.
False
4
The condition in a selection structure must evaluate to either a True or False answer only.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Comparison operators are also referred to as ____ operators.
A) syntax
B) Boolean
C) arithmetic
D) relational
A) syntax
B) Boolean
C) arithmetic
D) relational
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
In Visual Basic, ____ is the not equal to operator.
A) >>
B) >=
C) <=
D) <>
A) >>
B) >=
C) <=
D) <>
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
String comparisons in Visual Basic are case-sensitive.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
In Visual Basic, ____ is the greater than or equal to operator.
A) >>
B) >=
C) <=
D) <>
A) >>
B) >=
C) <=
D) <>
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
You use the ____ method to convert a string to uppercase.
A) Upper
B) ConvertUpper
C) ParseUpper
D) ToUpper
A) Upper
B) ConvertUpper
C) ParseUpper
D) ToUpper
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
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
A) true
B) right
C) correct
D) specific
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
You use the ____ method to convert a string to lowercase.
A) Lower
B) ConvertLower
C) ParseLower
D) ToLower
A) Lower
B) ConvertLower
C) ParseLower
D) ToLower
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
The numbers chosen from the Visual Basic pseudo-random number generator are completely random because a definite mathematical algorithm is used to select them.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
Another term for a selection structure is a ____ structure.
A) sequential
B) decision
C) form
D) repetition
A) sequential
B) decision
C) form
D) repetition
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
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
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
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
A) statement clause
B) operator block
C) statement block
D) comparison clause
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
In a dual-alternative selection structure, the word "else" to denote the beginning of the ____ path.
A) true
B) false
C) correct
D) wrong
A) true
B) false
C) correct
D) wrong
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
You do not always need to include the ____ clause in an If...Then...Else statement.
A) If
B) Then
C) Else
D) End If
A) If
B) Then
C) Else
D) End If
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
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
A) If...Then...Else
B) Do...Loop
C) Begin..End
D) Select...Case
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
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
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 50 flashcards in this deck.
Unlock Deck
k this deck
20
Variables declared within a statement block are referred to as ____ variables.
A) global
B) transient
C) block-level
D) internal
A) global
B) transient
C) block-level
D) internal
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
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
A) And
B) Or
C) AndAlso
D) OrElse
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
If the intAge variable contains the number 30, the condition If intAge > 20 AndAlso intAge < 30 Then will evaluate to
A) True
B) False
C) Yes
D) No
A) True
B) False
C) Yes
D) No
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
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
A) range checking
B) data verification
C) data validation
D) absolute programming
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
____________________ tables summarize how the computer evaluates the logical operators in an expression.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
Truth tables summarize how the computer evaluates the ____ operators in an expression.
A) integer
B) logical
C) arithmetic
D) string
A) integer
B) logical
C) arithmetic
D) string
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
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
A) comparison
B) string
C) open
D) closed
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
A logical operator where the compound condition evaluates to False only when both sub-conditions are False.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
A logical operator where the compound condition evaluates to False only when both sub-conditions are False.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The concatenation operator.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The concatenation operator.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
Specifies the decision you are making.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
Specifies the decision you are making.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The less than operator.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The less than operator.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
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 50 flashcards in this deck.
Unlock Deck
k this deck
32
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The greater than operator.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The greater than operator.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The logical operator where the compound condition evaluates to True only when both sub-conditions are True.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
The logical operator where the compound condition evaluates to True only when both sub-conditions are True.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
A(n) ______________________________ is a device that produces a sequence of numbers that meet certain statistical requirements for randomness.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
Advances the insertion point to the next line in a control.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
Advances the insertion point to the next line in a control.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
You create a Random object by declaring it in a(n) ____________________ statement.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
____________________ operators allow you to combine two or more conditions into one compound condition.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
Requires a specific set of tasks to be performed only when the condition is true.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
Requires a specific set of tasks to be performed only when the condition is true.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Match each item with a statement below.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
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.
a.ControlChars.NewLine constant
f.AndAlso
b.condition
g.&
c.>
h.single-alternative selection structure
d.dual-alternative selection structure
i.OrElse
e.<
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.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
Pseudo-random numbers are chosen with equal probability from a(n) ____ set of numbers.
A) unlimited
B) finite
C) infinite
D) select
A) unlimited
B) finite
C) infinite
D) select
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
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 50 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 50 flashcards in this deck.
Unlock Deck
k this deck
43
When do you use a selection structure?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
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 50 flashcards in this deck.
Unlock Deck
k this deck
45
How do you connect or link two strings together?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
Explain what happens when you use the AndAlso operator.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
Describe the purpose of the text box CharacterCasing property.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
What is a pseudo-random number generator?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
Explain what happens when you use the OrElse operator.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
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 50 flashcards in this deck.
Unlock Deck
k this deck