Chapter 17 An Procedure Does Not Return Value a

subject Type Homework Help
subject Pages 3
subject Words 628
subject Authors Diane Zak

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
Chapter 17: Talk to Me (Function Procedures)
TRUE/FALSE
1. Function procedures are referred to more simply as structures.
2. The header and footer in a function are identical to the header and footer in a sub procedure.
3. A Sub procedure’s header includes the As dataType section.
4. In most cases, the last statement within a function is Update expression.
5. As is true with a Sub procedure, a function can receive information either by value or by reference.
6. After creating a function, you can invoke it from one or more places in an application’s code.
7. You invoke a function that you create in exactly the same way as you invoke one of Visual Basic’s
built-in functions.
8. When invoking a function, the data type and position of each argument does not need to agree with the
data type and position of its corresponding parameter.
9. The statement that invokes a function will always assign the function’s return value to a variable.
10. When changing the Sub keyword in a header to Function, the Code Editor automatically changes
the Sub keyword in the footer to the Function keyword.
11. Allowing more than one procedure to change the contents of a memory location can lead to subtle
errors that are difficult to find, especially in large applications.
page-pf2
12. Fewer unintentional errors occur in applications when memory locations have the maximum scope
needed.
13. Most programmers pass a variable by reference only when a procedure needs to produce more than
one result.
14. In most cases, it is better to use a function rather than a Sub procedure that passes a variable by
reference.
MULTIPLE CHOICE
1. A(n) ____ procedure returns a value after performing its assigned task.
a.
Return
c.
Function
b.
Sub
d.
Assignment
2. A(n) ____ procedure does not return a value.
a.
Sub
c.
Assignment
b.
Function
d.
Static
3. The function’s header and footer contain the ____ keyword.
a.
Sub
c.
SubFunction
b.
FunctionProcedure
d.
Function
4. The sub procedure’s header and footer contain the ____ keyword.
a.
Sub
c.
SubProcedure
b.
Function
d.
Subroutine
5. A ____’s header includes the As dataType section.
a.
procedure
c.
caller
b.
function
d.
program
6. You use the ____ section of the function’s header to specify the data type of the value returned by the
function.
a.
Like
c.
Type
b.
Dim
d.
As dataType
page-pf3
7. If the function returns a string, you enter ____ at the end of the header.
a.
String As
c.
As String
b.
(String)
d.
Type As StringType
8. If the function returns a Double number, you enter ____ at the end of the header.
a.
Number Double
c.
(Double)
b.
As Double
d.
Type as DoubleType(Double)
9. The information a function receives is listed in the ____ in the header.
a.
parameterList
c.
return type
b.
data type
d.
function name
10. In a function, the data type of the expression in the Return statement must agree with the data type
specified in the ____ section of the header.
a.
Type As dataType
c.
As dataType (Return)
b.
Return As dataType
d.
As dataType
11. Like Sub procedure names, function names typically begin with a(n) ____.
a.
noun
c.
adjective
b.
verb
d.
adverb
12. When invoking a function, the number of arguments should agree with the number of parameters listed
in the function’s ____.
a.
data type
c.
return type
b.
parameterList
d.
return list
13. You know that a variable is passed by value when the keyword ____ appears before the parameter in
the function’s header.
a.
ByRef
c.
ByVal
b.
ByValue
d.
ByReference
14. A ____ under a variable in the Code Editor window indicates that it has not been declared.
a.
bold color
c.
green color
b.
jagged line
d.
dashed line

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.