Chapter 14 Counter controlled Loop Uses Counter

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

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
Chapter 14: Let Me Count the Ways (Counter-Controlled Loops)
TRUE/FALSE
1. A counter-controlled loop can be either a pretest loop or a posttest loop.
2. A pretest counter loop can only be coded using the Do…Loop statement.
3. The For...Next statement provides the most convenient way to code a posttest counter loop.
4. You do not need to specify the name of the counter variable in the Next clause, but doing so is highly
recommended because it makes your code more self-documenting.
5. When you declare a variable in the For clause, the variable stays in the computer’s internal memory
when the loop ends.
6. You can declare the counter variable in a Dim statement, as long as the Dim statement appears
somewhere after the For…Next statement.
7. The For…Next statement’s counter variable must be numeric.
8. The My.Computer object provides access to several objects, such as your computer’s Audio object.
9. If the audio file is not in the project’s bin\Debug folder, you will need to include the path to the file in
the fileName argument.
10. To have the Audio object play an audio file, you use its Sound method.
11. The mathematical formula for calculating a periodic payment on a loan is rather complex, so Visual
Basic provides a method that performs the calculation for you.
page-pf2
12. In the Financial.Pmt method, if Rate is a monthly interest rate, then NPer must specify the number of
monthly payments.
13. With the negation operator, a positive number preceded by the negation operator remains a positive
number.
14. When concatenating strings, you must be sure to include a space before and after the ampersand.
15. You can use the ControlChars.NextLine constant to advance the insertion point to the next line in a
control, file, or printout.
MULTIPLE CHOICE
1. A loop whose instructions you want processed a precise number of times is often referred to as a ____
loop.
a.
conditional
c.
counter-controlled
b.
precision
d.
sequential
2. A counter-controlled loop uses a counter ____ to keep track of the number of times the loop
instructions are processed.
a.
variable
c.
condition
b.
constant
d.
control
3. You code a posttest counter-controlled loop using the ____ statement.
a.
Execute…Until
c.
For…Next
b.
Do...Loop
d.
Do…Counter
4. The counter variable must be a(n) ____ variable.
a.
iterative
c.
alphanumeric
b.
alpha
d.
numeric
5. You can use the ____ portion of the For clause to declare the counter variable.
a.
As dataType
c.
Dim As dataType
b.
dataType
d.
Dim dataType
page-pf3
6. When you declare a variable in the For clause, the variable has ____ scope and can be used only
within the For...Next loop.
a.
program
c.
solution
b.
block
d.
method
7. When a variable is declared in a(n) ____ statement at the beginning of a procedure, it has procedure
scope and can be used by the entire procedure.
a.
Dim
c.
As
b.
New
d.
Create
8. Fewer unintentional errors occur in applications when the variables are declared using the ____ scope
needed.
a.
broadest
c.
minimum
b.
most open
d.
maximum
9. The ____ object refers to your computer.
a.
This.Computer
c.
Local.Computer
b.
My.ComputerObject
d.
My.Computer
10. To have an application play an audio file while it is running, you use the syntax ____.
a.
My.Computer.Play(fileName)
c.
My.Computer.Audio.Play(fileName)
b.
Play(filename)
d.
fileName.Play
11. Visual Basic’s ____ feature exposes a set of commonly used objects to the programmer.
a.
Obj
c.
MyObj
b.
My
d.
ComObj
12. The ____ method contains a complex mathematical formula for calculating a periodic payment.
a.
Fincl.Pmt
c.
Fin.Pmt
b.
Financial.Pmt
d.
Fin.Payment
13. The ____ operator reverses the sign of a number.
a.
sign change
c.
sign
b.
change
d.
negation
14. You connect or link strings using the ____ operator, which is the ampersand (&).
a.
join
c.
concatenation
b.
connect
d.
link
page-pf4
15. The Enter key on your keyboard is represented by the ____ constant.
a.
ControlChars.NextLine
c.
ControlChars.SpaceLine
b.
ControlChars.NewLine
d.
ControlChars.EnterLine

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.