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
What is the difference between a Sub procedure and a Function procedure?
(Essay)
4.9/5
(37)
Write the code for a Sub procedure named CalculateBonus.The procedure receives three decimal variables representing the salary,bonus rate,and bonus amount.The procedure should calculate the bonus amount by multiplying the salary by the bonus rate.Create your own variable names.
(Essay)
4.9/5
(48)
It is a common practice to begin a procedure's name with a(n)____.
(Multiple Choice)
4.8/5
(32)
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 calculates an ending inventory amount based on a beginning inventory amount,sales,and returns.You need to create a function to calculate the ending inventory using three passed Integer variables: intBegin,intSales,and intReturns.Which of the following procedure headers should be used?
(Multiple Choice)
4.7/5
(25)
An event procedure is a Function procedure that is associated with a specific object and event.
(True/False)
4.9/5
(30)
A ____ is similar to a list box in that it allows the user to select from a list of choices.
(Multiple Choice)
4.9/5
(41)
Like the first item in a list box,the first item in a combo box has an index of ____.
(Multiple Choice)
4.7/5
(38)
How do the parameterList of a procedure header and the argumentList of a Call statement relate to each other?
(Essay)
4.8/5
(40)
A(n)____ is processed only when it is called (invoked)from code.
(Multiple Choice)
4.8/5
(40)
The number of arguments listed in the Call statement's argumentList should agree with the number of parameters listed in the parameterList in the procedure header.
(True/False)
4.7/5
(41)
Write the code to add Freshman,Sophomore,Junior,and Senior to the Class combo box.Use the SelectedItem property to make Freshman the default item.
(Essay)
4.9/5
(32)
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 needs to calculate sales tax for purchases.You decide to simplify the code by putting the sales tax calculation in a function.The returned value from the function is then added to the Subtotal,and the result is stored in the decTotal variable.Which of the following statements will call the GetSalesTax function and return a value to be used in the Total calculation?
(Multiple Choice)
4.9/5
(35)
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
-' calculate and return the miles per gallon
Private Function GetMPG(ByVal dblMiles,
ByVal dblGallons)As Double
Return dblMPG = dblMiles / dblGallons
End Sub
' call the function to calculate miles per gallon
' pass variables for the calculation
intMPG = GetMPG()
(Essay)
4.8/5
(38)
An application uses a message box to ask users whether they want to exit the application,and the return value is stored in the dlgButton variable.Write the statement needed to stop the computer from closing the form if the user selects the No button in the message box.
(Essay)
4.8/5
(34)
Write the code for a Sub procedure named CalculateAverage that receives four decimal variables (the first three by value and the last one by reference).The procedure should use the first three variables to calculate the average and then store the result in the fourth variable.
(Essay)
4.8/5
(30)
The ____ keyword in a function header identifies the data type of the data being returned.
(Multiple Choice)
4.8/5
(36)
Write the code for a Sub procedure named InitializeVariables.The Sub procedure will assign the number 0 to the intTotalCars,intTotalTrucks,intTotalSUVs.Then write the code to call the procedure.
(Essay)
4.9/5
(37)
Which of the following is a valid header for a procedure that is passed the number 9.75?
(Multiple Choice)
4.9/5
(32)
Showing 41 - 60 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)