The items in a list box belong to a collection called the………..
a) Collection
b) Items Collection
c) Items Add
d) Add
Explanation: The items in a list box belong to a collection called the Items collection. A collection is a group of individual objects treated as one unit. The first item in the Items collection appears as the first item in the list box. The second item in the collection appears as the second item in the list box, and so on.
You specify each item to display in a list box using the Items collection’s…...
a) Add method
b) Subtract method
c) Divide method
d) Multiply method
Explanation: A unique number called an index identifies each item in the Items collection. The first item in the collection (which also is the first item in the list box) has an index of 0. The second item has an index of 1, and so on. You specify each item to display in a list box using the Items collection’s Add method.
Every variable has both a value and ……
a) Unique address
b) Value
c) Name
d) Relative address
Explanation: Every variable has both a value and a unique address that represents its location in the computer’s internal memory. Visual Basic allows you to pass either a copy of the variable’s value or the variable’s address to the receiving procedure.
Passing a copy of the variable is referred to as…
a) Pass by value
b) Pass by address
c) Pass by reference
d) Pass by pointer
Explanation: Passing a copy of the variable’s value is referred to as passing by value. Passing a variable’s address is referred to as passing by reference. The method you choose—by value or by reference—depends on whether you want the receiving procedure to have access to the variable in memory. In other words, it depends on whether you want to allow the receiving procedure to change the variable’s contents.
Passing a variable’s address is referred to as……….
a) Pass by value
b) Pass by address
c) Pass by reference
d) Pass by pointer
Explanation: Passing a copy of the variable’s value is referred to as passing by value. Passing a variable’s address is referred to as passing by reference. The method you choose—by value or by reference—depend on whether you want the receiving procedure to have access to the variable in memory. In other words, it depends on whether you want to allow the receiving procedure to change the variable’s contents.
To pass a variable by value, you include the keyword……….. before the name of its corresponding parameter.
a) ByVal
b) Val
c) PassVal
d) Pass
Explanation: To pass a variable by value, you include the keyword ByVal before the name of its corresponding parameter in the receiving procedure’s parameter list. When you pass a variable by value, the computer passes a copy of the variable’s contents to the receiving procedure. When only a copy of the contents is passed, the receiving procedure is not given access to the variable in memory. Therefore, it cannot change the value stored inside the variable. It is appropriate to pass a variable by value when the receiving procedure needs to know the variable’s contents, but it does not need to change the contents. Unless you specify otherwise, variables in Visual Basic are automatically passed by value.