Deck 7: Using Procedures and Exception Handling
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/112
Play
Full screen (f)
Deck 7: Using Procedures and Exception Handling
1
A Sub procedure can return ____ value(s)to the calling procedure.
A) 0
B) 1
C) 2
D) 3
A) 0
B) 1
C) 2
D) 3
A
2
The Project ____ appears as a single window in the Visual Studio IDE.
A) Manager
B) Control
C) Designer
D) Application
A) Manager
B) Control
C) Designer
D) Application
C
3
The index number of a ComboBox object can be assigned to a(n)____ data type variable.
A) Decimal
B) Integer
C) Whole
D) Null
A) Decimal
B) Integer
C) Whole
D) Null
B
4
If the user selects the first item in a ComboBox like the one in the accompanying figure,the SelectedIndex property will have the value ____.
A) -1
B) 0
C) 1
D) 2
A) -1
B) 0
C) 1
D) 2
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
5
The ____ keyword is placed before the Sub keyword when creating a Sub procedure to specify that the procedure can be called only by code within the class in which it exists.
A) Contained
B) Private
C) Inner
D) Distinct
A) Contained
B) Private
C) Inner
D) Distinct
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
6
The Project Designer provides a central location for managing project ____.
A) properties
B) settings
C) resources
D) all of the above
A) properties
B) settings
C) resources
D) all of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
7
A(n)____ is a named set of code that performs a given task.
A) parameter
B) procedure
C) argument
D) index
A) parameter
B) procedure
C) argument
D) index
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
8
The ____ Information dialog box contains values that include the program title,description,company,product,and copyright date.
A) Assembly
B) ActiveX
C) Activity
D) Argument
A) Assembly
B) ActiveX
C) Activity
D) Argument
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
9
The ____ property allows you to change the generic graphic on the splash screen.
A) BackGround
B) BackImage
C) BackgroundImage
D) BackGroundPicture
A) BackGround
B) BackImage
C) BackgroundImage
D) BackGroundPicture
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
10
A(n)____ is a value that can be passed to a procedure when the procedure is called.
A) parameter
B) sub
C) index
D) argument
A) parameter
B) sub
C) index
D) argument
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
11
The ____ prefix is used when naming a ComboBox object like the one in the accompanying figure. 
A) cmb
B) cbo
C) cbx
D) cmo

A) cmb
B) cbo
C) cbx
D) cmo
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
12
The ____ event of a ComboBox object is triggered when the user changes the selection.
A) SelectedIndex
B) IndexChanged
C) SelectedIndexChanged
D) ChangedSelectedIndex
A) SelectedIndex
B) IndexChanged
C) SelectedIndexChanged
D) ChangedSelectedIndex
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
13
A ____ procedure completes its task but does not return any data to the calling procedure.
A) Private
B) Sub
C) Function
D) Public
A) Private
B) Sub
C) Function
D) Public
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
14
Arguments are contained inside ____ after the name of the procedure to be called.
A) braces
B) parentheses
C) brackets
D) quotation marks
A) braces
B) parentheses
C) brackets
D) quotation marks
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
15
To pause a splash screen for a specific time period,you can call the ____ procedure.
A) Suspend
B) Sleep
C) Pause
D) Halt
A) Suspend
B) Sleep
C) Pause
D) Halt
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
16
To execute code in a procedure,a procedure ____ must be made.
A) invocation
B) cast
C) call
D) metric
A) invocation
B) cast
C) call
D) metric
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
17
A ____ screen can be added to engage the user while the application is loading.
A) startup
B) flash
C) title
D) splash
A) startup
B) flash
C) title
D) splash
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
18
If the third item in a ComboBox list is selected by the user,the SelectedIndex property of the ComboBox will have the value ____.
A) 1
B) 2
C) 3
D) 4
A) 1
B) 2
C) 3
D) 4
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
19
Using the ____ procedure will cause the application to pause a specific amount of time.
A) Stop
B) Pause
C) Wait
D) Sleep
A) Stop
B) Pause
C) Wait
D) Sleep
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
20
The ____ property of a ComboBox object returns a string value that represents the selected list item.
A) SelectedItem
B) ListItem
C) ThisItem
D) NewIndex
A) SelectedItem
B) ListItem
C) ThisItem
D) NewIndex
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
21
The keyword ____ is used in a Function procedure to return a single value.
A) SendVal
B) Return
C) ReturnVal
D) ReturnValue
A) SendVal
B) Return
C) ReturnVal
D) ReturnValue
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
22
The ____ exception type occurs when a procedure is called and the result is not possible.
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
23
A ____ procedure returns a single value to the calling procedure.
A) Form
B) Sub
C) Function
D) Splash
A) Form
B) Sub
C) Function
D) Splash
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
24
A Function procedure can pass back ____ value(s)using the Return statement to the calling procedure.
A) 0
B) 1
C) 2
D) 3
A) 0
B) 1
C) 2
D) 3
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
25
In a Function procedure,the ____ of the return value is listed in the procedure declaration.
A) data type
B) parameter
C) limit
D) index
A) data type
B) parameter
C) limit
D) index
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
26
The ____ exception type occurs when a variable with no value is passed to a procedure.
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
27
A Try-Catch structure ____ Catch blocks of code.
A) cannot contain any
B) can contain one
C) can contain two
D) can contain any number of
A) cannot contain any
B) can contain one
C) can contain two
D) can contain any number of
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
28
To return multiple variables from a Function procedure,arguments passed ____ must be used.
A) ByVal
B) BySub
C) ByRef
D) ByArg
A) ByVal
B) BySub
C) ByRef
D) ByArg
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
29
A variable declared as Private at the ____ level can be accessed by procedures and events within the class but not by any code outside of the class.
A) block
B) local
C) global
D) class
A) block
B) local
C) global
D) class
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
30
The keyword(s)____ is/are used to specify the termination of a Try-Catch block of code.
A) Terminate
B) Conclude
C) End Try
D) Quit Catch
A) Terminate
B) Conclude
C) End Try
D) Quit Catch
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
31
When an argument is passed ____,you are passing a reference to the variable that holds the value instead of the value itself.
A) ByRef
B) ByHand
C) ByVal
D) ByVar
A) ByRef
B) ByHand
C) ByVal
D) ByVar
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
32
The ____ exception type is used to catch all generic exceptions within a Try-Catch structure.
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
33
The ____ exception type occurs when a value is divided by zero.
A) DivisionError
B) ZeroError
C) DivideByZeroException
D) ZeroDivisionError
A) DivisionError
B) ZeroError
C) DivideByZeroException
D) ZeroDivisionError
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
34
The ____ exception type occurs when a value exceeds its assigned data type.
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
A) NullReferenceException
B) ArgumentNullException
C) OverflowException
D) SystemException
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
35
The ____ exception type occurs when a variable is converted to another data type that is not possible.
A) TypeException
B) TypeMismatchException
C) FormatMismatchException
D) FormatException
A) TypeException
B) TypeMismatchException
C) FormatMismatchException
D) FormatException
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
36
A ____ procedure can pass only one value back to the calling procedure.
A) Value
B) Sub
C) Return
D) Function
A) Value
B) Sub
C) Return
D) Function
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
37
When an argument is passed ____,it means the Sub procedure has access to the value of the passed argument,but does not actually reference the variable declared in the calling procedure.
A) ByRef
B) ByHand
C) ByVal
D) ByVar
A) ByRef
B) ByHand
C) ByVal
D) ByVar
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
38
In a Try-Catch structure,the ____ keyword precedes code that will always execute regardless of whether any exception occurred.
A) Else
B) Finally
C) Catch
D) Next
A) Else
B) Finally
C) Catch
D) Next
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
39
A Sub procedure ____ argument(s).
A) cannot accept any
B) can accept one
C) can accept two
D) can accept any number of
A) cannot accept any
B) can accept one
C) can accept two
D) can accept any number of
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
40
To detect exceptions and take corrective action,the ____ structure is used.
A) Try-Catch
B) Try-Code
C) Catch-Error
D) Try-CatchError
A) Try-Catch
B) Try-Code
C) Catch-Error
D) Try-CatchError
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
41
You should select the ByVal option if you intend to change the original value when it is passed to the Sub procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
42
When the SelectedIndex property of a ComboBox has the value of 0,it indicates that no selection was made by the user.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
43
A splash screen can be used to make a program appear to load faster than it actually does._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
44
When you pass a variable as an argument that was declared with the ByVal keyword in a procedure,that procedure cannot change the original value of the variable.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
45
____ is an exception type that can be handled by a Try-Catch block.
A) TextException
B) DivideByZeroException
C) OverflowException
D) FormatException
A) TextException
B) DivideByZeroException
C) OverflowException
D) FormatException
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
46
The ____ object can trigger a SelectedIndexChanged event when a selection is made.
A) ComboBox
B) DropDownList
C) SelectionBox
D) ListBox
A) ComboBox
B) DropDownList
C) SelectionBox
D) ListBox
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
47
A Sub procedure is called with a statement consisting of ____.
A) the title of the program
B) the procedure name
C) the master variable
D) a set of parentheses
A) the title of the program
B) the procedure name
C) the master variable
D) a set of parentheses
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
48
Tap or click the list arrow on the left side of a ComboBox object to view the contents._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
49
You specify you want to pass a value by reference by entering the keyword ByRef in the Sub procedure declaration.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
50
A Sub procedure does not return any data to the calling procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
51
____ procedures are a kind of procedure provided by Visual Basic.
A) Integrated
B) Master
C) Sub
D) Function
A) Integrated
B) Master
C) Sub
D) Function
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
52
The Elements property of a ComboBox contains the choices available to the ComboBox._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
53
A ComboBox object consists of three parts._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
54
Sub procedures are automatically executed when events such as the user clicking a button occur.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
55
The keywords End SubProcedure signifies the end of a Sub procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
56
A dollar sign ($)as the first character in a variable means it is a class variable that can be referenced in any procedure within the class.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
57
To make a splash screen display for a certain period of time,the Suspend procedure is placed in the form load event handler._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
58
After a Sub procedure has completed its execution,program control returns to the calling procedure and program execution resumes in the calling procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
59
The SelectedItem property of a ComboBox returns an integer indicating which choice is currently selected.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
60
The Project Designer contains fields to enter ____.
A) program title
B) company name
C) file version
D) Sub procedure
A) program title
B) company name
C) file version
D) Sub procedure
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
61
A Finally statement is required after each Catch block in a Try-Catch structure to execute any necessary clean-up code.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
62
If the Private keyword is omitted,the default option is Public.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
63
A(n)____________________ object includes a text box that allows the user to enter text,and a list box that displays a list of items from which the user can select one.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
64
The Private keyword is required in a Function procedure declaration.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
65
You can pass at most two arguments to a Sub procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
66
If an exception occurs in the Try section of a Try-Catch structure and there is no matching Catch block,the program will stop.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
67
You must specify a return data type in the procedure declaration to define the type of variable that is being returned to the calling procedure by the Function procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
68
In a Function procedure declaration,any lines of code after a Return statement will not be executed.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
69
If a Sub procedure has more than one argument,the variables are passed in the same order in which they appear in the procedure call statement.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
70
You cannot exclude the receiving variable in the procedure call.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
71
A Function procedure returns a single value to the calling procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
72
The ____________________ property is used to display a graphic on a splash screen like the one shown in the accompanying figure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
73
The ____________________ property of a ComboBox is assigned a number that represents the selected item.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
74
A Function procedure can pass many values back to the calling procedure.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
75
The ____________________ property is used to return the string value of the selected choice in a ComboBox.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
76
The statement End Procedure is used to signify the end of a Function declaration.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
77
As shown in the accompanying figure,an opening screen that appears as an application is loading is called a(n)____________________ screen. 

Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
78
A DivideByZeroException occurs when a value is divided by zero.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
79
If the code in the Try section of a Try-Catch structure generates an error,the program will not be terminated when the exception occurs.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
80
Only six different types of exceptions can occur in a Visual Basic program.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck