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 Menus35 Questions
Exam 8: Arrays and More34 Questions
Exam 9: Files, Printing, and Structure36 Questions
Exam 10: Working With Databases32 Questions
Exam 11: Developing Web Applications33 Questions
Exam 12: Classes, Collections, and Inheritance36 Questions
Select questions type
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?
Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
B
Which of the following can be returned by a function?
Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
D
When a parameter is declared using the ______qualifier, the procedure has access to the original argument variable and may make changes to its value.
Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
C
In the context of Visual Basic procedures and functions, what is an argument?
(Multiple Choice)
4.8/5
(39)
A procedure may not be accessed by procedures from another class or form if the ______access specifier is used.
(Multiple Choice)
5.0/5
(33)
What is the syntax error in the following procedure?
Sub DisplayValue(Dim intNumber As Integer)
MessageBox.Show(intNumber.ToString())
End Sub
(Multiple Choice)
4.9/5
(41)
All of the following are true about functions except __________.
(Multiple Choice)
4.9/5
(33)
Which of the following code examples is a function that will accept three integer parameters, calculate their average, and return the result?
(Multiple Choice)
4.9/5
(42)
Which of the following calls to the GetNumber procedure is not valid?
Sub GetNumber(ByVal intNumber as Integer)
' (procedure body)
End Sub
(Multiple Choice)
4.8/5
(45)
Which statement is true in regard to passing an argument by value to a procedure?
(Multiple Choice)
4.8/5
(44)
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
(Multiple Choice)
4.8/5
(39)
If you do not provide an access specifier for a procedure, it will be designated ______by default.
(Multiple Choice)
4.9/5
(35)
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.8/5
(28)
Which of the following procedure declarations matches the call to the IsLetter procedure below? Dim strText as String = txtInput.Text
Dim blnLetter as Boolean = IsLetter(strText)
(Multiple Choice)
4.8/5
(33)
What is assigned to lblDisplay.Text when the following code executes?
Dim intNumber As Integer = 4
AddOne(intNumber, 6)
LblDisplay.Text = intNumber
' Code for AddOne
Public Sub AddOne(ByVal intFirst As Integer, ByVal intSecond As Integer)
IntFirst += 1
IntSecond += 1
End Sub
(Multiple Choice)
4.9/5
(26)
By writing your own procedures, you can ______an applications code, that is, break it into small, manageable procedures.
(Multiple Choice)
4.9/5
(36)
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
(Multiple Choice)
4.9/5
(37)
When calling a procedure, passed arguments and declared parameters must agree in all of the following ways except __________.
(Multiple Choice)
4.8/5
(29)
Which debugging command executes a function call without stepping through function's statements?
(Multiple Choice)
4.9/5
(40)
A is a special variable that receives a value being passed into a procedure or function.
(Multiple Choice)
4.8/5
(49)
Showing 1 - 20 of 31
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)