FOR VISUAL BASICS 2012 QUESTION 33 What is incorrect about the following functio
ID: 3838012 • Letter: F
Question
FOR VISUAL BASICS 2012
QUESTION 33
What is incorrect about the following function? Function Sum (ByVal intX As Integer,ByVal intY As Integer) As Integer Dim intAns as Integer intAns = intX + intY End Function
A. intAns should not be declared inside the Function.
B. the as Integer at the end of the Function heading should be eliminated.
C.the function does not return a value
D.parameters intA and intB should be declared as ByRef
QUESTION 34
What is wrong with the following code?
Dim intIndex As Integer
For intIndex = 5 To 1
ListBox.Items.Add(intIndex.ToString)
Next
A The Next statement must read Next intIndex.
B A For Next loop cannot be used to count backward.
C intIndex is declared incorrectly for use with this type of loop.
D You need to specify a negative step value in order to execute this loop.
Explanation / Answer
Question 33
C.the function does not return a value
The function should have return type Integer as in the declaration
Question 34
D You need to specify a negative step value in order to execute this loop.
As loop index is decrementing from 5 to 1 a negative step value should be specified
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.