Question
____ 11. What is the value of intTotal after the following code executes? Dim intNumber1 As Integer = 2 Dim intNumber2 As Integer = 3
____ 11. What is the value of intTotal after the following code executes?
Dim intNumber1 As Integer = 2 Dim intNumber2 As Integer = 3 Dim intTotal As Integer intTotal = AddSquares(intNumber1, intNumber2)
Function AddSquares(ByVal intA As Integer, ByVal intB As Integer) As Integer intA = intA * intA intB = intB * intB Return intA + intB intA = 0 intB = 0 End Function
a. 0 b. 5 c. 10 d. 13
____ 15. Which of the following examples correctly uses an input box to assign a value to an integer, and returns the integer to the calling program using a reference parameter?
a. Sub GetInput(ByVal intNumber As Integer) intNumber = CInt(InputBox(Enter an Integer)) End Sub
b. Sub GetInput(ByRef intNumber As Integer) intNumber = CInt(InputBox(Enter an Integer)) End Sub
c. Sub GetInput(ByRef intNumber As Integer) intNumber = CInt(InputBox(Enter an Integer)) Return intNumber End Sub
d. Sub GetInput() Dim intNumber As Integer intNumber = CInt(InputBox(Enter an Integer)) End Sub
____ 22. Choose a new, more descriptive name for the WhatIsIt function based on the result of the code below.
Function WhatIsIt(ByVal intRepeat as Integer) as Integer Dim intResult as Integer = 1 Dim intCount as Integer For intCount = 1 to intRepeat intResult = intResult * 2 Next intCount Return intResult End Function a. PowersOfTwo b. SquareRootsOfTwo
c. MultiplyByTwo d. TwoPlusTwo
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started