Deck 7: Sub and Function Procedures

Full screen (f)
exit full mode
Question
A Sub procedure will never return a value after code execution.
Use Space or
up arrow
down arrow
to flip the card.
Question
The first item in a ListBox list carries an index value of 1.
Question
A user-defined Sub procedure can contain only one parameter which is in the procedure header.
Question
When the ByVal keyword is used on a parameterlist the original data may be changed.
Question
The keyword Public indicates that only the procedures in the current form can access the procedure.
Question
In Visual Basic .NET, the Value keyword is used to pass a variable by value.
Question
In Visual Basic .NET the default method of passing variable data is "by value."
Question
A Function procedure will always return a value after execution.
Question
All procedures, including user-defined Sub procedures, have a procedure header and a procedure footer.
Question
The e parameter of an event procedure provides additional information provided by the object that raised the event.
Question
A block of program code that performs a specific task is called a procedure.
Question
In Visual Basic .NET, passing a variable's address is referred to as passing by reference and the keyword to do this is ByRef.
Question
All event procedures have at least two parameters, sender and e, when the procedure is invoked.
Question
Functions are different from Sub Procedures in that you cannot pass (send) information to functions.
Question
The number, type, and order of the arguments in an argumentlist on a Call statement must match the parameters in the parameterlist on the Sub procedure header.
Question
The sender parameter of an event procedure contains the internal memory address of the object that raised the event.
Question
The Math.Round() method has an optional third argument.
Question
When a TextBox control's KeyPress event occurs, the address of the text box is passed to the KeyPress event procedure and stored in the procedure's sender parameter.
Question
A user-defined Sub procedure will return a value after code execution.
Question
The procedure footer for a Sub procedure is always End Procedure.
Question
The maximum number of items that should be displayed in a ListBox is ____.

A) 2
B) 4
C) 6
D) 8
Question
In Visual Basic .NET, the Reference keyword is used when passing the address of the variable.
Question
The Items collection's ____ method is used to specify the items to be displayed in a list box control.

A) Add( )
B) Display( )
C) List( )
D) Insert( )
Question
When the ListBox sorted property is true, items in the collection are listed in ____.

A) reverse of the order received
B) order received
C) ascending order
D) descending order
Question
When an application is started, Visual Basic .NET automatically processes the code contained in the Startup object.
Question
Which accessibility provides unlimited access to procedures in the current form?

A) Private
B) Public
C) Protected
D) Friend
Question
When the ListBox sorted property is false, items in the collection are listed in ____.

A) reverse of the order received
B) order received
C) ascending order
D) descending order
Question
To determine which item in a ListBox was selected you could use the ____ property.

A) ItemSelected
B) SelectedIndex
C) CheckedItem
D) CheckedIndex
Question
Math.Round(3.234, 2) returns the number 3.24.
Question
The keyword in a function that causes the data to be returned is the ____ keyword.

A) Send
B) DataType
C) Submit
D) Return
Question
The code to insert a pet type of "parakeet" into a ListBox collection called PetsListBox at the last slot when "dog", "cat", and "horse" already exist, is ____.

A) Me.PetsListBox.Items.Insert(4, "parakeet")
B) Me.PetsListBox.Items.Insert(0, "parakeet")
C) Me.PetsListBox.Items.add("parakeet")
D) Me.PetsListBox.Items.addLast("parakeet")
Question
The variables passed in a Call statement are separated by commas.
Question
The Me method used to close a form is ____.

A) Terminate()
B) Stop()
C) Close()
D) End()
Question
The minimum number of items that should be displayed in a ListBox is ____.

A) 1
B) 2
C) 3
D) 4
Question
Which accessibility limits access to procedures in the current form?

A) Private
B) Public
C) Protected
D) Friend
Question
When the sorted property of a ListBox control is true, the ASCII collating sequence would put which category of data first?

A) Lowercase letters
B) Uppercase letters
C) Numbers
D) Symbols
Question
Some functions like Val and InputBox are referred to as intrinsic functions in Visual Basic .NET.
Question
The keyword in a function header that identifies the data type of the data being returned is the ____ keyword.

A) Is
B) DataType
C) As
D) Return
Question
The ____ method allows a programmer the control to display a form object on the screen.

A) ShowScreen( )
B) ShowDialog( )
C) ShowPanel( )
D) ShowForm()
Question
The default number of choices that a user can make from a ListBox control is ____.

A) zero
B) one
C) two
D) six
Question
When passing arguments, if the programmer wants to protect the original variable, the programmer should pass the variable by ____.

A) reference
B) value
C) argument
D) parameter
Question
A list box's ____ property can be used to select a list box item from code.

A) ItemChosen
B) SelectedItem
C) ListedItem
D) CheckedItem
Question
To place the state name "Ohio" in the Items collection you use the ____ method.

A) Add
B) Increase
C) Include
D) New
Question
When passing arguments, if the programmer wants to grant access to the original variable, the programmer should pass the variable by ____.

A) reference
B) value
C) parameter
D) argument
Question
To remove the TabIndex boxes from the form the programmer would press the ____ key.

A) Enter
B) Esc
C) Shift
D) Ctrl
Question
The number of choices a user may select from a listbox control is set on the ____ property.

A) ChoicesMode
B) SelectionMode
C) ItemsMode
D) SelectedItem
Question
The following items are included in a Listbox Items Collection: 1, 2, 10, 3, 20 If the Sorted property is set to true, in what order will the values appear?

A) 1, 2, 10, 3, 20
B) 1, 2, 3, 10, 20
C) 1, 10, 2, 20, 3
D) 20, 10, 3, 2, 1
Question
The procedure header for a Sub procedure will show the variables, which are called ____.

A) arguments
B) parameters
C) values
D) references
Question
The expression Math.Round(287.876, 2) yields a value of ____.

A) 287.87
B) 287.88
C) 290.00
D) 288.00
Question
A list box's ____ event occurs each time a different value is selected in the list box.

A) ValueChanged
B) SelectedValueChanged
C) SelectedTextChanged
D) ItemSelected
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Sub and Function Procedures
1
A Sub procedure will never return a value after code execution.
True
2
The first item in a ListBox list carries an index value of 1.
False
3
A user-defined Sub procedure can contain only one parameter which is in the procedure header.
False
4
When the ByVal keyword is used on a parameterlist the original data may be changed.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
The keyword Public indicates that only the procedures in the current form can access the procedure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
In Visual Basic .NET, the Value keyword is used to pass a variable by value.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
In Visual Basic .NET the default method of passing variable data is "by value."
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
A Function procedure will always return a value after execution.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
All procedures, including user-defined Sub procedures, have a procedure header and a procedure footer.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
The e parameter of an event procedure provides additional information provided by the object that raised the event.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
A block of program code that performs a specific task is called a procedure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
In Visual Basic .NET, passing a variable's address is referred to as passing by reference and the keyword to do this is ByRef.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
All event procedures have at least two parameters, sender and e, when the procedure is invoked.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Functions are different from Sub Procedures in that you cannot pass (send) information to functions.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
The number, type, and order of the arguments in an argumentlist on a Call statement must match the parameters in the parameterlist on the Sub procedure header.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The sender parameter of an event procedure contains the internal memory address of the object that raised the event.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
The Math.Round() method has an optional third argument.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
When a TextBox control's KeyPress event occurs, the address of the text box is passed to the KeyPress event procedure and stored in the procedure's sender parameter.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
A user-defined Sub procedure will return a value after code execution.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
The procedure footer for a Sub procedure is always End Procedure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
The maximum number of items that should be displayed in a ListBox is ____.

A) 2
B) 4
C) 6
D) 8
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
In Visual Basic .NET, the Reference keyword is used when passing the address of the variable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
The Items collection's ____ method is used to specify the items to be displayed in a list box control.

A) Add( )
B) Display( )
C) List( )
D) Insert( )
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
When the ListBox sorted property is true, items in the collection are listed in ____.

A) reverse of the order received
B) order received
C) ascending order
D) descending order
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
When an application is started, Visual Basic .NET automatically processes the code contained in the Startup object.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Which accessibility provides unlimited access to procedures in the current form?

A) Private
B) Public
C) Protected
D) Friend
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
When the ListBox sorted property is false, items in the collection are listed in ____.

A) reverse of the order received
B) order received
C) ascending order
D) descending order
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
To determine which item in a ListBox was selected you could use the ____ property.

A) ItemSelected
B) SelectedIndex
C) CheckedItem
D) CheckedIndex
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
Math.Round(3.234, 2) returns the number 3.24.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The keyword in a function that causes the data to be returned is the ____ keyword.

A) Send
B) DataType
C) Submit
D) Return
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
The code to insert a pet type of "parakeet" into a ListBox collection called PetsListBox at the last slot when "dog", "cat", and "horse" already exist, is ____.

A) Me.PetsListBox.Items.Insert(4, "parakeet")
B) Me.PetsListBox.Items.Insert(0, "parakeet")
C) Me.PetsListBox.Items.add("parakeet")
D) Me.PetsListBox.Items.addLast("parakeet")
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
The variables passed in a Call statement are separated by commas.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
The Me method used to close a form is ____.

A) Terminate()
B) Stop()
C) Close()
D) End()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
The minimum number of items that should be displayed in a ListBox is ____.

A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
Which accessibility limits access to procedures in the current form?

A) Private
B) Public
C) Protected
D) Friend
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
When the sorted property of a ListBox control is true, the ASCII collating sequence would put which category of data first?

A) Lowercase letters
B) Uppercase letters
C) Numbers
D) Symbols
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
Some functions like Val and InputBox are referred to as intrinsic functions in Visual Basic .NET.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
The keyword in a function header that identifies the data type of the data being returned is the ____ keyword.

A) Is
B) DataType
C) As
D) Return
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
The ____ method allows a programmer the control to display a form object on the screen.

A) ShowScreen( )
B) ShowDialog( )
C) ShowPanel( )
D) ShowForm()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
The default number of choices that a user can make from a ListBox control is ____.

A) zero
B) one
C) two
D) six
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
When passing arguments, if the programmer wants to protect the original variable, the programmer should pass the variable by ____.

A) reference
B) value
C) argument
D) parameter
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
A list box's ____ property can be used to select a list box item from code.

A) ItemChosen
B) SelectedItem
C) ListedItem
D) CheckedItem
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
To place the state name "Ohio" in the Items collection you use the ____ method.

A) Add
B) Increase
C) Include
D) New
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
When passing arguments, if the programmer wants to grant access to the original variable, the programmer should pass the variable by ____.

A) reference
B) value
C) parameter
D) argument
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
To remove the TabIndex boxes from the form the programmer would press the ____ key.

A) Enter
B) Esc
C) Shift
D) Ctrl
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
The number of choices a user may select from a listbox control is set on the ____ property.

A) ChoicesMode
B) SelectionMode
C) ItemsMode
D) SelectedItem
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
The following items are included in a Listbox Items Collection: 1, 2, 10, 3, 20 If the Sorted property is set to true, in what order will the values appear?

A) 1, 2, 10, 3, 20
B) 1, 2, 3, 10, 20
C) 1, 10, 2, 20, 3
D) 20, 10, 3, 2, 1
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
The procedure header for a Sub procedure will show the variables, which are called ____.

A) arguments
B) parameters
C) values
D) references
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
The expression Math.Round(287.876, 2) yields a value of ____.

A) 287.87
B) 287.88
C) 290.00
D) 288.00
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
A list box's ____ event occurs each time a different value is selected in the list box.

A) ValueChanged
B) SelectedValueChanged
C) SelectedTextChanged
D) ItemSelected
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.