Deck 5: 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
Match between columns
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/42
Play
Full screen (f)
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
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
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
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)
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
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
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
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
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
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
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
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
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
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
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)
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
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
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
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
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
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
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
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