Chapter 9 An Selection Structure

subject Type Homework Help
subject Pages 4
subject Words 637
subject Authors Diane Zak

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
Chapter 9: Time to Leave the Nest (Nested Selection Structures)
TRUE/FALSE
1. You use the selection structure to make a decision and then select the appropriate patheither the true
path or the false pathbased 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 selection structure.
6. The instructions in the true path of a nested structure should not be indented within the inner selection
structure.
7. Nested selection structures are often used when coding applications whose interface contains radio
buttons.
8. Radio button are labeled using book title capitalization in the radio button’s Text property.
9. It is not customary in Windows applications to have one of the radio buttons in a group already
selected when the interface first appears.
10. The default radio button is the radio button that is automatically selected when an interface first
appears.
11. If the property contains the Boolean value True, the radio button is not selected.
page-pf2
12. When using radio buttons, a group box is necessary only if you want to include more than one group
on a form.
13. Like expressions containing comparison operators, expressions containing logical operators always
evaluate to a Boolean value.
14. Logical operators are always evaluated before any comparison operators in an expression.
15. The AndAlso operator has a precedence number of 2.
MULTIPLE CHOICE
1. 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
2. A(n) ____ selection structure is contained within the outer selection structure.
a.
nested
c.
coated
b.
indented
d.
shell
3. 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
4. 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
5. ____ allow you to limit the user to only one choice from a group of two or more related but mutually
exclusive choices.
a.
Check boxes
c.
Text boxes
b.
Radio buttons
d.
Labels
page-pf3
6. A ____ is a control that serves simply as a container for other controls.
a.
check box
c.
group box
b.
radio box
d.
text box
7. 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
8. Expressions containing logical operators always evaluate to a(n) ____ value.
a.
Boolean
c.
string
b.
conditional
d.
compound
9. With the ____ operator, all conditions must be True for the compound condition to be True.
a.
AndAlso
c.
AndElse
b.
OrAlso
d.
OrElse
10. 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
11. 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
12. 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
13. 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
page-pf4
14. When the computer processes the expression 12 > 0 AndAlso 12 < 10 * 2, it evaluates the ____
operator first.
a.
*
c.
>
b.
<
d.
AndAlso
15. When the computer processes the expression 12 > 0 AndAlso 12 < 10 * 2, it evaluates the ____
operator last.
a.
*
c.
>
b.
<
d.
AndAlso

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.