This preview has intentionally blurred parts. Sign up to view the full document

View Full Document

Unformatted Document Excerpt

Chapter 6 Multiple Choice Identify the letter of the choice that best completes the statement or answers the question. ____ 1. If you want to prevent statements from outside a form from accessing a procedure, you set the access specifier to in the procedures declaration. a. Private b. Public c. Static d. Scope ____ 2. If a procedure is called more than once in a program, the values stored in the procedures local variables will persist only if declared with the keyword. a. Const b. Public c. Static d. Dim ____ 3. A is a special variable in a Sub or Function heading that receives an arguments value/address from a calling procedure. a. temporary variable b. constant c. original argument d. parameter ____ 4. Which of the following calls does not pass in valid arguments to the following GetANumber subprocedure? Sub GetANumber(ByVal intNumber as Integer) ' does some code End Sub a. GetANumber(intX) b. GetANumber(3 + 5 * 8 + intX) c. GetANumber(intX + 3, intY) d. GetANumber(Cint(txtNumber.Text)) ____ 5. When calling a Sub Procedure, the arguments and the corresponding parameters must agree in all of the following ways except one of the following. a. The order of arguments and parameters must correspond b. The names of the arguments and parameters must correspond c. The type the arguments and parameters must correspond d. the number of the arguments and the parameters must be the same Chapter 6 1 ____ 6. Which of the following code is a correctly written function named Average that will accept three integers as parameters, calculate their average and return the result. a. Private Function Average(intX As Integer, intY As Integer, intZ As Integer) As Single Average = (intX + intY + intZ) / 3 End Function b. Private Function Average(ByVal intX As Integer, ByVal intY As Integer, _ ByVal intZ As Integer) As Single Average = intX + intY + intZ / 3 Return Average End Function c. Private Function Average( _ ByRef intX As Integer,ByRef intY As Integer, ByRef intZ As Integer, ByRef Average As Double) Average = (intX + intY + intZ)/3 End Function d. Private Function Average (ByVal intX As Integer,ByVal intY As Integer, _ ByVal intZ As Integer) As Single Return (intX + intY + intZ) / 3 End Function ____ 7. What is wrong with the following function?... View Full Document

End of Preview

Sign up now to access the rest of the document