Beruflich Dokumente
Kultur Dokumente
2. A Do While...Loop will evaluate the condition before executing the loop, whereas a Do...Loop
will execute the loop at least once.
6. Counters and accumulators both modify a variable by updating the variable’s previous value.
The accumulator variable can be used to keep a running total or sum and is incremented in
various ways by a changing value, while the counter variable is used to keep count of how
many times something has happened and is usually incremented by a constant value of 1.
Answers will vary for the uses of each type, but can include: an accumulator variable can be
used in a loop to keep track of a running total or used with multiplication to find a factorial,
as in the Factorial application from the review in the text, and a counter variable can be used
in a Do...Loop statement to keep track of how many scores are entered in an input box or in a
For loop to keep track of an index in an array.
7. A Do...Loop executes until a condition is false, while a For...Next executes a set number of
times.
9. Integer and Double can only be set to numeric values, whereas String data types can be
comprised of both numeric and text values.
10. String variables are called objects because the String data type is a class.
12. Strings can be combined to create a new string by using the Concat() String class method or
the & operator.
18.
21. a) True.
b) True.
c) True.
d) False. Accumulator variables can modify any type of numeric variable.
e) False. A flag, also called a sentinel, is a condition used to signify that a loop should stop
executing.
f) False. Sentinel values can be whatever value makes sense for the application.
g) False. sum is used as a counter variable.
h) False. The keyword Step controls the increment of decrement amount of a counter in a
For...Next statement.
i) False. String is a class, not a primitive data type.
j) True.
k) True.
l) False. vbTab is a constant that can be used to place a string of eight characters into a field.
m) False. The corresponding uppercase and lowercase letters have separate Unicode values.
n) False. Compare returns a 0, a positive number, or a negative number.
o) True.