Deck 9: Sub and Function Procedures
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Match between columns
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/42
Play
Full screen (f)
Deck 9: Sub and Function Procedures
1
Passing a variable's address to the receiving procedure is referred to as passing by ____.
A) address
B) parameter
C) reference
D) value
A) address
B) parameter
C) reference
D) value
C
2
A(n) ____ Sub procedure is processed only when called (invoked) from code.
A) independent
B) event
C) parameterized
D) modular
A) independent
B) event
C) parameterized
D) modular
A
3
In most cases, the procedure header begins with the ____ keyword.
A) Public
B) Private
C) Sub
D) Call
A) Public
B) Private
C) Sub
D) Call
B
4
To pass a variable by value, you include the keyword ____ before the name of its corresponding parameter in the procedure's parameterList.
A) ByRef
B) ByVal
C) ByValue
D) ByName
A) ByRef
B) ByVal
C) ByValue
D) ByName
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
5
You cannot pass information to a function by reference.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
6
The parameterList lists the data type and name of one or more memory locations, called ____.
A) functions
B) parameters
C) clauses
D) constants
A) functions
B) parameters
C) clauses
D) constants
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
7
Procedure names are usually entered using ____.
A) Top case
B) Fermi case
C) Pascal case
D) Hill case
A) Top case
B) Fermi case
C) Pascal case
D) Hill case
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
8
The ____ clause in an event procedure's header indicates the object and event associated with the procedure.
A) Call
B) ByVal
C) ByRef
D) Handles
A) Call
B) ByVal
C) ByRef
D) Handles
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
9
When you pass a variable by value, the receiving procedure can change the value stored inside the variable.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
10
Unlike a Sub procedure header, a function's header includes the ____ section.
A) Handles
B) ByVal
C) As datatype
D) ByRef
A) Handles
B) ByVal
C) As datatype
D) ByRef
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
11
The position of the arguments listed in the calling statement should agree with the position of the parameters listed in the receiving procedure's _____.
A) variables
B) parameterList
C) Return statement
D) arguments
A) variables
B) parameterList
C) Return statement
D) arguments
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
12
The number of arguments in the Call statement's argumentList should agree with the number of parameters in the procedure's parameterList .
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
13
You can invoke an independent Sub procedure using the ____ statement.
A) event
B) parameter
C) method
D) calling
A) event
B) parameter
C) method
D) calling
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
14
After creating your own function in Visual Basic, you can invoke it from one or more places in an application's code.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
15
The rules for naming an independent Sub procedure are the same as those for naming variables.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
16
You pass a variable by ____ when you want the receiving procedure to change the contents of the variable.
A) value
B) memory
C) name
D) reference
A) value
B) memory
C) name
D) reference
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
17
The process of manually walking through your code, using sample data is called ____.
A) prototyping
B) desk-checking
C) screening
D) reviewing
A) prototyping
B) desk-checking
C) screening
D) reviewing
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
18
The procedure footer for a Sub procedure is always ____.
A) Private Sub
B) End Case
C) Exit Sub
D) End Sub
A) Private Sub
B) End Case
C) Exit Sub
D) End Sub
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
19
The ____ keyword tells the computer to pass the variable's address rather than a copy of its contents.
A) ByName
B) ByMem
C) ByRef
D) ByVal
A) ByName
B) ByMem
C) ByRef
D) ByVal
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
20
A(n) ____ procedure returns a value after performing its assigned task.
A) Argument
B) Function
C) Parameter
D) Sub
A) Argument
B) Function
C) Parameter
D) Sub
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
21
The function's header and footer contain the ____ keyword.
A) Sub
B) Funct
C) Return
D) Function
A) Sub
B) Funct
C) Return
D) Function
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
22
When you pass a variable ____________________, the computer passes a copy of the variable's contents to the receiving procedure.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
23
What kind of access to a variable does the receiving procedure have when the variable is passed to it by value?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
24
What is desk-checking?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
25
You can use the ____ function to return a number rounded to a specific number of decimal places.
A) Round
B) Math.Round
C) Round.Math
D) Math.Digits
A) Round
B) Math.Round
C) Round.Math
D) Math.Digits
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
26
The last statement in a function is typically the ____________________.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
27
To pass a variable by reference in Visual Basic, you include the keyword ____________________ before the variable's corresponding parameter in the receiving procedure's header.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
28
What is the difference between Sub procedures and Function procedures?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
29
What is an independent Sub procedure?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
30
What are two reasons for using independent Sub procedures in code?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
31
You can cast a variable from the Object data type to a different data type by using the ____operator.
A) TryType
B) CastType
C) TryCast
D) Cast
A) TryType
B) CastType
C) TryCast
D) Cast
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
32
What are the rules for naming an independent Sub procedure?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
33
The process of converting a variable from one data type to another is referred to as ____.
A) casting
B) changing
C) transferring
D) translating
A) casting
B) changing
C) transferring
D) translating
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
34
Variables declared using the ____ data type do not have a set of properties.
A) Object
B) Integer
C) Double
D) String
A) Object
B) Integer
C) Double
D) String
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
35
On what basis should you decide whether you should pass a variable's value or address to the receiving procedure?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
36
Associating a procedure with more than one object and event allows the programmer to avoid ____________________ code in different parts of the program..
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
37
What is an event procedure?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
38
How do you invoke a function that you have created?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
39
Desk‑checking is also called ____________________ because you use a pencil and paper to follow each of the instructions by hand.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
40
The Return statement's syntax is ____ expression , where expression represents the one and only value that will be returned to the statement invoking the function.
A) Return
B) Send
C) Handles
D) As
A) Return
B) Send
C) Handles
D) As
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
42
What is the TryCast operator use for?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck