Exam 6: Procedures and Functions
Exam 1: Introduction to Programming and Visual Basic40 Questions
Exam 2: Creating Applications With Visual Basic36 Questions
Exam 3: Variables and Calculations41 Questions
Exam 4: Making Decisions39 Questions
Exam 5: Lists and Loops36 Questions
Exam 6: Procedures and Functions31 Questions
Exam 7: Multiple Forms, Modules, and Menus36 Questions
Exam 8: Arrays and More34 Questions
Exam 9: Files, Printing, and Structures36 Questions
Exam 10: Working With Databases32 Questions
Exam 11: Developing Web Applications33 Questions
Exam 12: Classes, Collections, and Inheritance36 Questions
Select questions type
A is a special variable that receives a value being passed into a procedure or function.
Free
(Multiple Choice)
4.8/5
(39)
Correct Answer:
D
Which of the following procedure declarations matches the call to the IsLetter procedure below? Dim strText as String = txtInput.Text
Dim blnLetter as Boolean = IsLetterstrText)
Free
(Multiple Choice)
4.9/5
(36)
Correct Answer:
C
When debugging a program in break mode, the Step Into command causes the currently highlighted line of code to execute.
Free
(True/False)
4.9/5
(36)
Correct Answer:
True
By writing your own procedures, you can _an applications code, that is, break it into small, manageable procedures.
(Multiple Choice)
4.8/5
(34)
Choose a new, more descriptive name for the WhatIsIt function based on the result of the code below. Function WhatIsItByVal 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
(Multiple Choice)
4.9/5
(35)
What will be the value of dblSum after the button btnAdd is clicked, assuming that 25 is entered by the user into txtNum1, and 35 is entered into txtNum2? Private Sub btnAdd_ClickByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd.Click
Dim dblNum1, dblNum2, dblSum As Double
DblNum1 = CDbltxtNum1.Text)
DblNum2 = CDbltxtNum2.Text)
DblSum = SumdblNum1, dblNum2)
LblSum.Text = dblSum.ToString)
End Sub
Function SumByVal dblNum1 As Double, ByVal dblNum2 As Double) as Double
Return dblNum1 + dblNum2
End Function
(Multiple Choice)
4.7/5
(41)
Which of the following does not apply to procedures and functions?
(Multiple Choice)
4.8/5
(37)
Which of the following calls to the GetNumber procedure is not valid? Sub GetNumberByVal intNumber as Integer)
' procedure body)
End Sub
(Multiple Choice)
5.0/5
(28)
Which is the correct way to define a function named Square that receives an integer and returns an integer representing the square of the input value?
(Multiple Choice)
4.7/5
(38)
A procedure may not be accessed by procedures from another class or form if the _access specifier is used.
(Multiple Choice)
4.8/5
(44)
Which debugging command executes a function call without stepping through function's statements?
(Multiple Choice)
4.7/5
(35)
When calling a procedure, passed arguments and declared parameters must agree in all of the following ways except .
(Multiple Choice)
4.7/5
(43)
Which of the following procedures will keep track of the number of times it was called?
(Multiple Choice)
4.9/5
(40)
Which of the following functions accepts a parameter named dblSales and returns the commission to the calling statement? Assume that the commission should equal the sales multiplied by the commission rate. Use the following table as a guide to the calculation of the commission rate.
(Multiple Choice)
4.9/5
(33)
Although you can omit the ByVal keyword in a parameter variable declaration, it is still a good idea to use it.
(True/False)
4.9/5
(45)
If you do not provide an access specifier for a procedure, it will be designated _by default.
(Multiple Choice)
4.9/5
(39)
When a parameter is declared using the _qualifier, the procedure has access to the original argument variable and may make changes to its value.
(Multiple Choice)
4.9/5
(34)
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 = AddSquaresintNumber1, intNumber2)
Function AddSquaresByVal intA As Integer, ByVal intB As Integer) As Integer
IntA = intA * intA
IntB = intB * intB
Return intA + intB
IntA = 0
IntB = 0
End Function
(Multiple Choice)
4.8/5
(48)
Showing 1 - 20 of 31
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)