Chapter 12 If the user clicks the OK button, the Input

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

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
Chapter 12: How Long Can This Go On? (Pretest Loops)
TRUE/FALSE
1. All computer programs are written using one or more of three control structures: sequence, selection,
or repetition.
2. A repetition structure can only be a pretest loop.
3. A condition can contain variables, constants, properties, methods, or operators.
4. Like the condition in the If…Then…Else statement, the condition in the Do…Loop statement must
evaluate to a Boolean value.
5. Updating refers to the process of either adding a number to or subtracting a number from a counter’s
value.
6. The loop condition is represented by a parallelogram in a flowchart.
7. Like counter variables, accumulator variables are initialized inside the loop.
8. Repetition structures use accumulator variables to tally information such as the total dollar amount of a
week’s payroll.
9. Like counter variables, accumulator variables are updated outside the loop.
10. The priming read is used to prepare or set up a loop.
11. Any code containing a priming read must also include a matching update read within the loop.
page-pf2
12. A loop that has no way to end is called an infinite loop or an forever loop.
13. The value returned by the InputBox function is the same whether the user clicks the OK button, Cancel
button, or Close button.
14. The Windows standard is to use book title capitalization for the prompt, but sentence capitalization for
the title.
15. You can use the arithmetic assignment operator (+=) to abbreviate the statement intNum = intNum
+ 1 as follows: intNum = 1.
MULTIPLE CHOICE
1. Programmers use the ____ structure when they need the computer to repeatedly process one or more
program instructions until some condition is met, at which time the processing ends.
a.
decision
c.
selection
b.
repetition
d.
declaration
2. In a(n) ____ loop, the loop condition is evaluated before the instructions within the loop are processed.
a.
pretest
c.
inline test
b.
posttest
d.
execute
3. In a(n) ____ loop, the evaluation occurs after the instructions within the loop are processed.
a.
pretest
c.
execute
b.
inline test
d.
posttest
4. You can use the ____ statement to code both a pretest loop and a posttest loop.
a.
For…Next
c.
Next…For
b.
While…Wend
d.
Do…Loop
5. You can use the ____ method to redraw the form.
a.
Redraw
c.
Refresh
b.
Renew
d.
Update
6. You can delay program execution using the ____ method.
a.
Pause
c.
Delay
page-pf3
b.
Sleep
d.
Refresh
7. A(n) ____ variable is a numeric variable used for adding something together.
a.
static
c.
accumulator
b.
named
d.
counter
8. In a loop that begins with a priming read, the ____ provides the way to end a loop.
a.
changing read
c.
ending read
b.
update read
d.
special read
9. The result of forgetting to enter the update read is a(n) ____ loop.
a.
empty
c.
infinite
b.
temporary
d.
short-circuited
10. If the user clicks the OK button, the InputBox function returns ____.
a.
an empty string
b.
the value contained in the input area of the dialog box
c.
OKValue
d.
Nothing
11. If the user clicks either the Cancel button in the dialog box or the Close button on the dialog box’s title
bar, the InputBox function returns ____.
a.
an empty string
b.
the value contained in the input area of the dialog box
c.
CancelValue
d.
nothing
12. The empty string is represented by the ____ constant in Visual Basic.
a.
Nothing
c.
String.Empty
b.
String.Nothing
d.
Empty.String
13. When entering the InputBox function in the Code Editor window, the prompt, title, and
defaultResponse arguments must be enclosed in ____.
a.
quotation marks
c.
square brackets
b.
asterisks
d.
slashes
14. Which of the following statements increments the intNum variable’s value by 2?
a.
intNum = intNum 2
b.
intNum -= 2
c.
intNum += 2
page-pf4
d.
intNum ++ 2
15. If a run time error occurs, you can stop the application by clicking DEBUG on the menu bar and then
clicking ____.
a.
End
c.
End Debugging
b.
Stop
d.
Stop Debugging

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.