Ch 6
An argument in a calling statement can be literal, a named constant, a keyword, or a variable.
True
The computer automatically processes an event procedure when the event occurs.
True
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
When you pass a variable ____, the computer passes only the contents of the variable to the receiving procedure.
by value
You pass a variable ____ when the receiving procedure needs to know the variable's contents, but the receiving procedure does not need to change the contents.
by value
Which of the following statements will determine the number of items in the list portion of the Department combo box?
cboDepartment.Items.Count
A ____ is similar to a list box in that it allows the user to select from a list of choices.
combo box
The syntax ____ assigns a return value to a variable.
dblNewPrice = GetNewPrice(dblCurrentPrice)
A(n) ____ is processed only when it is called (invoked) from code.
independent Sub procedure
The syntax ____ displays a return value.
lblNewPrice.Text = GetNewPrice(dblCurrentPrice).ToString("C2")
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.
one less than
Like the first item in a list box, the first item in a combo box has an index of ____.
0
The expression Math.Round(287.876, 2) yields a value of ____.
287.88
Usually, the statement that invokes a function will assign the function's return value to a(n) ____.
variable
As you do with list boxes, you use the Items collection's ____ method to add an item to a combo box.
Add
The ____ keyword in a function header identifies the data type of the data being returned.
As
The syntax of the Call statement is ____.
Call procedureName([argumentList])
In a ____ combo box, the text portion is not editable.
DropDownList
A Function procedure does not return a value after performing its assigned task.
False
An event procedure is a Function procedure that is associated with a specific object and event.
False
Math.Round(3.234, 2) returns the number 3.24.
False
The names of the arguments in a Call statement need to be identical to the names of the corresponding parameters.
False
You can determine whether a variable is being passed by value or by reference by looking at the Call statement.
False
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.
FormClosing event
When using ____, you capitalize the first letter in the procedure name and the first letter of each subsequent word in the name.
Pascal case
Which of the following is a valid header for a procedure that is passed the number 9.75?
Private Function CalcSubtotal(ByVal decPrice As Decimal) As Decimal
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?
Private Function GetEndInventory(ByVal intBegin As Integer, ByVal intSales As Integer, ByVal intReturns As Integer) As Integer
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?
Private Sub DisplayMessage(ByVal strItem As String, ByVal decPrice As Decimal)
Which of the following is a valid header for a procedure that receives the address of a string variable and the address of an integer?
Private Sub GetInfo(ByRef strName As String, ByRef intAge As Integer)
In most cases, the last statement within a function is the ____ expression.
Return
Which of the following is a valid Return statement?
Return dblNumber
To sort the items in the list portion of a combo box, you use the combo box's ____ property.
Sorted