Deck 14: Let Me Count the Ways Counter-Controlled Loops

Full screen (f)
exit full mode
Question
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
Use Space or
up arrow
down arrow
to flip the card.
Question
You can declare the counter variable in a Dim statement, as long as the Dim statement appears somewhere after the For…Next statement.
Question
A counter-controlled loop can be either a pretest loop or a posttest loop.
Question
When you declare a variable in the For clause, the variable stays in the computer's internal memory when the loop ends.
Question
The For...Next statement provides the most convenient way to code a posttest counter loop.
Question
The counter variable must be a(n) ____ variable.

A) iterative
C) alphanumeric
B) alpha
D) numeric
Question
Fewer unintentional errors occur in applications when the variables are declared using the ____ scope needed.

A) broadest
C) minimum
B) most open
D) maximum
Question
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.
Question
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
Question
In the Financial.Pmt method, if Rate is a monthly interest rate, then NPer must specify the number of monthly payments.
Question
The My.Computer object provides access to several objects, such as your computer's Audio object.
Question
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
Question
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.
Question
A pretest counter loop can only be coded using the Do…Loop statement.
Question
You code a posttest counter-controlled loop using the ____ statement.

A) Execute…Until
C) For…Next
B) Do...Loop
D) Do…Counter
Question
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
Question
With the negation operator, a positive number preceded by the negation operator remains a positive number.
Question
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
Question
To have the Audio object play an audio file, you use its Sound method.
Question
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.
Question
The ____ method contains a complex mathematical formula for calculating a periodic payment.

A) Fincl.Pmt
C) Fin.Pmt
B) Financial.Pmt
D) Fin.Payment
Question
The ____ object refers to your computer.

A) This.Computer
C) Local.Computer
B) My.ComputerObject
D) My.Computer
Question
The ____ operator reverses the sign of a number.

A) sign change
C) sign
B) change
D) negation
Question
Visual Basic's ____ feature exposes a set of commonly used objects to the programmer.

A) Obj
C) MyObj
B) My
D) ComObj
Question
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
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 14: Let Me Count the Ways Counter-Controlled Loops
1
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
A
2
You can declare the counter variable in a Dim statement, as long as the Dim statement appears somewhere after the For…Next statement.
False
3
A counter-controlled loop can be either a pretest loop or a posttest loop.
True
4
When you declare a variable in the For clause, the variable stays in the computer's internal memory when the loop ends.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
The For...Next statement provides the most convenient way to code a posttest counter loop.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
The counter variable must be a(n) ____ variable.

A) iterative
C) alphanumeric
B) alpha
D) numeric
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
Fewer unintentional errors occur in applications when the variables are declared using the ____ scope needed.

A) broadest
C) minimum
B) most open
D) maximum
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
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.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
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
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
In the Financial.Pmt method, if Rate is a monthly interest rate, then NPer must specify the number of monthly payments.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
The My.Computer object provides access to several objects, such as your computer's Audio object.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
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
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
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.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
A pretest counter loop can only be coded using the Do…Loop statement.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
You code a posttest counter-controlled loop using the ____ statement.

A) Execute…Until
C) For…Next
B) Do...Loop
D) Do…Counter
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
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
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
With the negation operator, a positive number preceded by the negation operator remains a positive number.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
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
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
To have the Audio object play an audio file, you use its Sound method.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
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.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
The ____ method contains a complex mathematical formula for calculating a periodic payment.

A) Fincl.Pmt
C) Fin.Pmt
B) Financial.Pmt
D) Fin.Payment
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
The ____ object refers to your computer.

A) This.Computer
C) Local.Computer
B) My.ComputerObject
D) My.Computer
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
The ____ operator reverses the sign of a number.

A) sign change
C) sign
B) change
D) negation
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
Visual Basic's ____ feature exposes a set of commonly used objects to the programmer.

A) Obj
C) MyObj
B) My
D) ComObj
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
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
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 25 flashcards in this deck.