Exam 7: Sub and Function Procedures
Exam 1: An Introduction to Visual Basic 201544 Questions
Exam 2: Designing Applications60 Questions
Exam 3: Using Variables and Constants60 Questions
Exam 4: The Selection Structure60 Questions
Exam 5: More on the Selection Structure58 Questions
Exam 6: The Repetition Structure60 Questions
Exam 7: Sub and Function Procedures60 Questions
Exam 8: String Manipulation60 Questions
Exam 9: Arrays60 Questions
Exam 10: Structures and Sequential Access Files60 Questions
Exam 11: Classes and Objects60 Questions
Exam 12: Web Applications60 Questions
Exam 13: Working With Access Databases and Linq60 Questions
Exam 14: Access Databases and SQL60 Questions
Select questions type
Case 1 - MTN Outdoor
You have just started working for MTN Outdoor as a programmer. Your first assignment is to review and correct various code to use sub procedures and/or functions.
-Which of the following statements would invoke the DisplayMessage Sub procedure?
Free
(Multiple Choice)
4.9/5
(30)
Correct Answer:
B
Like a Sub procedure header,a Function procedure header includes the As dataType section.
Free
(True/False)
4.8/5
(30)
Correct Answer:
False
The computer automatically processes an event procedure when the event occurs.
Free
(True/False)
4.7/5
(37)
Correct Answer:
True
When using ____,you capitalize the first letter in the procedure name and the first letter of each subsequent word in the name.
(Multiple Choice)
4.7/5
(37)
Explain the difference between passing data by value and passing data by reference.
(Essay)
4.8/5
(39)
Write the code for a function named GetMajor.The function should prompt the user to enter a major field of study and then return the user's response.Then write a statement to invoke the GetMajor function,returning the result to the strCurrentMajor variable.
(Essay)
4.7/5
(32)
The names of the arguments in a Call statement need to be identical to the names of the corresponding parameters.
(True/False)
4.7/5
(31)
What are the three main reasons programmers use independent Sub procedures?
(Essay)
4.7/5
(35)
A combo box's ____ property contains the value that appears in the text portion of the control.
(Multiple Choice)
4.8/5
(33)
Usually,the statement that invokes a function will assign the function's return value to a(n)____.
(Multiple Choice)
4.8/5
(27)
A Function procedure does not return a value after performing its assigned task.
(True/False)
4.9/5
(29)
Write the code for a Sub procedure named DisplayAuto,which displays a message containing the two values passed to it: an automobile make and model.Use strMake and strModel as the parameters.Display the "You own a make model." message in a message box.Then write the statement to invoke the procedure,passing it the contents of the strBrand and strType variables,respectively.
(Essay)
4.8/5
(29)
A form's ____ procedure is responsible for verifying that the user wants to close the application,and then taking the appropriate action based on the user's response.
(Multiple Choice)
4.8/5
(40)
Case 1 - MTN Outdoor
You have just started working for MTN Outdoor as a programmer. Your first assignment is to review and correct various code to use sub procedures and/or functions.
-Which of the following statements would invoke the GetEndInventory function and assign the function's return value to the intEnd variable?
(Multiple Choice)
4.9/5
(30)
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
-Private Sub frmMain_FormClosing(ByVal sender As Object,ByVal e As System.Windows.Forms.FormClosingEventArgs)Handles Me.FormClosing
' verify that the user wants to exit the application
Dim dlgButton As DialogResult
dlgButton = MessageBox.Show("Do you want to exit?",
"Sample Program")
' if the No button was selected,don't close the form
If dlgButton = DialogResult.Yes Then
e.Cancel = TrueEnd IfEnd SubPrivate Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load' fill combo box with values, then select default valueFor intNumber As Integer From 0 Thru 10cboNumbers.Add(intNumber.ToString)Next intNumbercboNumbers.SelectedItem = FirstEnd Sub
(Essay)
4.9/5
(36)
Visual Basic allows you to specify that an argument in the Call statement is optional.
(True/False)
4.9/5
(42)
The expression Math.Round(287.876,2)yields a value of ____.
(Multiple Choice)
4.8/5
(34)
For the access key to work correctly in a combo box,you must set the label's TabIndex property to a value that is ____ the combo box's TabIndex value.
(Multiple Choice)
5.0/5
(36)
Case 1 - MTN Outdoor
You have just started working for MTN Outdoor as a programmer. Your first assignment is to review and correct various code to use sub procedures and/or functions.
-An application allows a user to scan a bar code of an item to determine the item price.A message that contains the item name and the item price should display.You need to create a Sub procedure to display the message.Which of the following procedure headers should be used?
(Multiple Choice)
5.0/5
(36)
Showing 1 - 20 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)