1. Which of the following is false?
a. A function returns only one value to the statement that invoked it.
b. A Sub procedure can accept only one item of data passed to it.
c. The parameterList in a procedure header is optional.
d. A function’s header specifies the data type of the function’s return
value.
2. What are the items that appear within parentheses in a calling statement called?
1. arguments
2. parameters
3. passers
4. callers
3. What are the items that appear within parentheses in a procedure header called?
1. arguments
2. parameters
3. passers
4. callers
4. Which of the following indicates whether a variable is being passed by value or by
reference?
1. the calling statement
2. the receiving procedure’s header
3. the statements entered within the receiving procedure
4. the calling procedure’s header
5. Which of the following statements invokes the GetArea Sub procedure, passing it
two variables by value?
1. GetArea(dblLength, dblWidth) As Double
2. GetArea(ByVal dblLength, ByVal dblWidth)
3. GetArea ByVal(dblLength, dblWidth)
, 4. GetArea(dblLength, dblWidth)
6. Which of the following is a valid header for a procedure that receives a copy of the
value stored in a String variable?
1. Private Sub DisplayName(ByCopy strName As String)
2. Private Sub DisplayName ByVal(strName As String)
3. Private Sub DisplayName(ByVal strName As String)
4. Private Sub DisplayName(ByRef strName As String)
7. Which of the following is a valid header for a procedure that receives an integer
followed by a number with a decimal place?
1. Private Sub GetFee(intBase As Value, decRate As Value)
2. Private Sub GetFee(ByRef intBase As Integer, ByRef decRate As Decimal)
3. Private Sub GetFee(ByVal intBase As Integer, ByVal decRate As Decimal)
4. Private Sub GetFee(ByCopy intBase As Integer, ByCopy decorate As Decimal)
8. Which of the following is false?
a. The order of the arguments listed in the calling statement should agree
with the order of the parameters listed in the receiving procedure's
header.
b. The data type of each argument in the calling statement should match
the data type of its corresponding parameter in the procedure header.
c. When you pass an item to a procedure by value, the procedure stores the
item's value in a separate memory location.
d. The name of each argument in the calling statement should be identical
to the name of its corresponding parameter in the procedure header.
9. Which of the following instructs a function to return the value stored in
the dblBonus variable?
1. Return dblBonus
2. Return ByVal dblBonus
3. Send dblBonus
a. A function returns only one value to the statement that invoked it.
b. A Sub procedure can accept only one item of data passed to it.
c. The parameterList in a procedure header is optional.
d. A function’s header specifies the data type of the function’s return
value.
2. What are the items that appear within parentheses in a calling statement called?
1. arguments
2. parameters
3. passers
4. callers
3. What are the items that appear within parentheses in a procedure header called?
1. arguments
2. parameters
3. passers
4. callers
4. Which of the following indicates whether a variable is being passed by value or by
reference?
1. the calling statement
2. the receiving procedure’s header
3. the statements entered within the receiving procedure
4. the calling procedure’s header
5. Which of the following statements invokes the GetArea Sub procedure, passing it
two variables by value?
1. GetArea(dblLength, dblWidth) As Double
2. GetArea(ByVal dblLength, ByVal dblWidth)
3. GetArea ByVal(dblLength, dblWidth)
, 4. GetArea(dblLength, dblWidth)
6. Which of the following is a valid header for a procedure that receives a copy of the
value stored in a String variable?
1. Private Sub DisplayName(ByCopy strName As String)
2. Private Sub DisplayName ByVal(strName As String)
3. Private Sub DisplayName(ByVal strName As String)
4. Private Sub DisplayName(ByRef strName As String)
7. Which of the following is a valid header for a procedure that receives an integer
followed by a number with a decimal place?
1. Private Sub GetFee(intBase As Value, decRate As Value)
2. Private Sub GetFee(ByRef intBase As Integer, ByRef decRate As Decimal)
3. Private Sub GetFee(ByVal intBase As Integer, ByVal decRate As Decimal)
4. Private Sub GetFee(ByCopy intBase As Integer, ByCopy decorate As Decimal)
8. Which of the following is false?
a. The order of the arguments listed in the calling statement should agree
with the order of the parameters listed in the receiving procedure's
header.
b. The data type of each argument in the calling statement should match
the data type of its corresponding parameter in the procedure header.
c. When you pass an item to a procedure by value, the procedure stores the
item's value in a separate memory location.
d. The name of each argument in the calling statement should be identical
to the name of its corresponding parameter in the procedure header.
9. Which of the following instructs a function to return the value stored in
the dblBonus variable?
1. Return dblBonus
2. Return ByVal dblBonus
3. Send dblBonus