Name:     ID: 
 
Email: 

COSC 2328 Chap 10 and 11

True/False
Indicate whether the statement is true or false.
 

 1. 

You use the selection structure to make a decision and then select the appropriate path—either the true path or the false path—based on the result.
 

 2. 

Only one path in a selection structure can include instructions that declare variables, perform calculations, and so on.
 

 3. 

Only one path in a selection structure can include other selection structures.
 

 4. 

You cannot use a nested selection structure when more than one decision must be made before the appropriate action can be taken.
 

 5. 

When only one decision needs to be made, it does not require a nested selected structure.
 

 6. 

The instructions in the true path of a nested structure should not be indented within the inner selection structure.
 

 7. 

There is no reason to swap values in the sum/difference problem presented in this chapter when the two numbers are equal.
 

 8. 

When comparing two numbers, keep in mind that the first number can be greater than, less than, or equal to the second number.
 

 9. 

Like expressions containing comparison operators, expressions containing logical operators always evaluate to a Boolean value.
 

 10. 

Logical operators are always evaluated before any comparison operators in an expression.
 

 11. 

The AndAlso operator has a precedence number of 2.
 

 12. 

The OrElse operator has a precedence number of 2.
 

 13. 

At times, you may need to create a selection structure that can choose from several alternatives.
 

 14. 

Using nested If…Then…Else statements is a much more convenient way of coding a multiple-path selection structure than using the If…ElseIf…Else statement.
 

 15. 

Variables declared with the Integer, Decimal, and Double data types can store numbers only.
 

 16. 

The value stored in the Text property is treated as alphanumeric text.
 

 17. 

As is true in most programming languages, string comparisons in Visual Basic are not case sensitive.
 

 18. 

In Visual Basic, the uppercase version of a letter is the same as its lowercase counterpart.
 

 19. 

Each character on the computer keyboard is stored differently in the computer’s internal memory.
 

 20. 

Unicode assigns a unique numeric value to each character used in the written languages of the world.
 

 21. 

The data type of the expressions in a Select Case statement does not need to be compatible with the data type of the selectorExpression.
 

 22. 

The If...Then...Else statement is the only statement you can use to code a multiple-path selection structure in Visual Basic.
 

 23. 

A radio button is created using the RadioButton tool in the toolbox, and it allows the user to choose more than one choice in a group of two or more related but not mutually exclusive choices.
 

 24. 

The minimum number of radio buttons in a group is two, because the only way to deselect a radio button is to select another radio button.
 

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 25. 

When either a selection structure’s true path or its false path contains another selection structure, the inner selection structure is referred to as a(n) ____ structure.
a.
indented
c.
nested selection
b.
nested
d.
indented selection
 

 26. 

A(n) ____ selection structure is contained within the outer selection structure.
a.
nested
c.
coated
b.
indented
d.
shell
 

 27. 

You use a ____ selection structure when more than one decision must be made before the appropriate action can be taken.
a.
shell
c.
logical
b.
nested
d.
split
 

 28. 

In a nested structure, the instructions in both the true and false paths should be ____ within the outer selection structure.
a.
assigned
c.
collected
b.
bracketed
d.
indented
 

 29. 

Logical operators, sometimes referred to as ____ operators, allow you to combine two or more conditions into one compound condition.
a.
truth
c.
Boolean
b.
compound
d.
syntactic
 

 30. 

Expressions containing logical operators always evaluate to a(n) ____ value.
a.
Boolean
c.
string
b.
conditional
d.
compound
 

 31. 

With the ____ operator, all conditions must be True for the compound condition to be True.
a.
AndAlso
c.
AndElse
b.
OrAlso
d.
OrElse
 

 32. 

With the ____ operator, only one of the conditions needs to be True for the compound condition to be True.
a.
AndAlso
c.
AndElse
b.
OrAlso
d.
OrElse
 

 33. 

If an expression contains logical operators, comparison operators, and arithmetic operators, ____.
a.
the comparison operators are evaluated first
b.
the arithmetic operators are evaluated first
c.
the logical operators are evaluated first
d.
the operators are evaluated in order
 

 34. 

If an expression contains logical operators, comparison operators, and arithmetic operators, ____.
a.
the comparison operators are evaluated last
b.
the arithmetic operators are evaluated last
c.
the logical operators are evaluated last
d.
the operators are evaluated in order
 

 35. 

When the computer processes the expression 12 > 0 AndAlso 12 < 10 * 2, it evaluates the ____ operator first.
a.
*
c.
>
b.
<
d.
AndAlso
 

 36. 

When the computer processes the expression 12 > 0 AndAlso 12 < 10 * 2, it evaluates the ____ operator last.
a.
*
c.
>
b.
<
d.
AndAlso
 

 37. 

The pseudocode “if the hours worked are greater than or equal to 0 but less than or equal to 40” is coded as ____ in Visual Basic.
a.
If decHours > 0 AndAlso decHours < 40
b.
If decHours => 0 AndAlso decHours =< 40
c.
If decHours >= 0 AndAlso decHours <= 40
d.
If decHours >= 40 AndAlso decHours <= 0
 

 38. 

Multiple-path selection structures or ____ selection structures can choose from several alternatives.
a.
complex
c.
extended
b.
staged
d.
control
 

 39. 

The ____ data type can store alphanumeric text, which is text that may contain letters, numbers, or special characters.
a.
String
c.
Integer
b.
Double
d.
Text
 

 40. 

The three-character ID used when naming String variables (and String named constants) is ____.
a.
sti
c.
srg
b.
str
d.
stg
 

 41. 

The code to create a String variable is ____.
a.
dim string strCode
c.
dim strCode as string
b.
dim strCode string
d.
dim Codestr as string
 

 42. 

____ is the universal coding scheme for characters.
a.
EBCDIC
c.
ASCII
b.
ANSI
d.
Unicode
 

 43. 

You use the ____ method to convert a string to uppercase.
a.
ConvToUpper
c.
ToUpper
b.
strUpper
d.
ConvUpper
 

 44. 

The Select Case statement begins with the keywords Select Case, followed by a(n) ____.
a.
listExpression
c.
expressionList
b.
expressionSelector
d.
selectorExpression
 

 45. 

To include more than one expression in an expressionList, you separate each expression with a ____.
a.
comma
c.
semicolon
b.
forward slash
d.
period
 

 46. 

You can specify a range of values in a Case clause’s ____, such as the values 1 through 4 or values greater than 10.
a.
statementList
c.
End Case
b.
expressionList
d.
Case
 

 47. 

Each radio button can have a unique ____ key that allows the user to select the button using the keyboard.
a.
choice
c.
select
b.
contact
d.
access
 

 48. 

The recommended maximum number of radio buttons in a group is ____.
a.
two
c.
seven
b.
five
d.
ten
 

 49. 

The selected button in a radio button group is called the ____ radio button and is either the radio button that represents the user’s most likely choice or the first radio button in the group.
a.
default
c.
likely
b.
first
d.
preselected
 

 50. 

You designate a radio button as the default radio button by setting the button’s ____ property to the Boolean value True.
a.
Display
c.
Selected
b.
Default
d.
Checked
 



 
         Start Over