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/103
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
To change the copyright date on a splash screen, you need to open the ____ Information dialog box.
A) Assembly
B) ActiveX
C) Activity
D) Argument
A) Assembly
B) ActiveX
C) Activity
D) Argument
A
3
The word ____ 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
B
4
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 103 flashcards in this deck.
Unlock Deck
k this deck
5
If the user selects the first item in a ComboBox, 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 103 flashcards in this deck.
Unlock Deck
k this deck
6
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 103 flashcards in this deck.
Unlock Deck
k this deck
7
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 103 flashcards in this deck.
Unlock Deck
k this deck
8
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 103 flashcards in this deck.
Unlock Deck
k this deck
9
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
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
10
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 103 flashcards in this deck.
Unlock Deck
k this deck
11
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 103 flashcards in this deck.
Unlock Deck
k this deck
12
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 103 flashcards in this deck.
Unlock Deck
k this deck
13
In a payroll program, a user could enter the number of hours worked, pay rate, and then select whether he or she are a full-time or part-time employee to submit his or her input. This last selection is an example of using a ComboBox object to handle a(n) ____.
A) value action
B) return index
C) decision tree
D) event
A) value action
B) return index
C) decision tree
D) event
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
14
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 103 flashcards in this deck.
Unlock Deck
k this deck
15
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 103 flashcards in this deck.
Unlock Deck
k this deck
16
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 103 flashcards in this deck.
Unlock Deck
k this deck
17
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 103 flashcards in this deck.
Unlock Deck
k this deck
18
The ____ prefix is used when naming a ComboBox object.
A) cmb
B) cbo
C) cbx
D) cmo
A) cmb
B) cbo
C) cbx
D) cmo
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
19
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
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
20
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 103 flashcards in this deck.
Unlock Deck
k this deck
21
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 103 flashcards in this deck.
Unlock Deck
k this deck
22
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 103 flashcards in this deck.
Unlock Deck
k this deck
23
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 103 flashcards in this deck.
Unlock Deck
k this deck
24
In a Try-Catch structure, the ____ statement is optional and always executes last.
A) Final
B) Finally
C) Last
D) End
A) Final
B) Finally
C) Last
D) End
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
25
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 103 flashcards in this deck.
Unlock Deck
k this deck
26
When a procedure is called, the call statement can pass a(n) ____ to the called procedure.
A) parameter
B) sub
C) index
D) argument
A) parameter
B) sub
C) index
D) argument
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
27
The ____ structure can be used to detect exceptions and take corrective action.
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 103 flashcards in this deck.
Unlock Deck
k this deck
28
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 103 flashcards in this deck.
Unlock Deck
k this deck
29
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 103 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 103 flashcards in this deck.
Unlock Deck
k this deck
31
A Try-Catch structure ____ Catch blocks of code.
A) cannot contain any
B) can contain one
C) can contain at most two
D) can contain any number of
A) cannot contain any
B) can contain one
C) can contain at most two
D) can contain any number of
Unlock Deck
Unlock for access to all 103 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 103 flashcards in this deck.
Unlock Deck
k this deck
33
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 103 flashcards in this deck.
Unlock Deck
k this deck
34
After the Sub procedure has completed its execution, program control returns to the ___________ and program execution resumes.
A) execution procedure
B) sub procedure
C) pass argument
D) calling procedure
A) execution procedure
B) sub procedure
C) pass argument
D) calling procedure
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
35
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 103 flashcards in this deck.
Unlock Deck
k this deck
36
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 103 flashcards in this deck.
Unlock Deck
k this deck
37
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 103 flashcards in this deck.
Unlock Deck
k this deck
38
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 103 flashcards in this deck.
Unlock Deck
k this deck
39
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 103 flashcards in this deck.
Unlock Deck
k this deck
40
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 103 flashcards in this deck.
Unlock Deck
k this deck
41
____ 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 103 flashcards in this deck.
Unlock Deck
k this deck
42
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 103 flashcards in this deck.
Unlock Deck
k this deck
43
The Elements of a ComboBox displays a list of items from which the user can select one item.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
44
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 103 flashcards in this deck.
Unlock Deck
k this deck
45
____ 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 103 flashcards in this deck.
Unlock Deck
k this deck
46
A Sub procedure does not return any data to the calling procedure.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
47
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 103 flashcards in this deck.
Unlock Deck
k this deck
48
A ComboBox object consists of three parts. _________________________
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
49
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 103 flashcards in this deck.
Unlock Deck
k this deck
50
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 103 flashcards in this deck.
Unlock Deck
k this deck
51
The Project Designer provides a central location for managing ____.
A) project properties
B) settings
C) resources
D) applications
A) project properties
B) settings
C) resources
D) applications
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
52
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 103 flashcards in this deck.
Unlock Deck
k this deck
53
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 103 flashcards in this deck.
Unlock Deck
k this deck
54
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 103 flashcards in this deck.
Unlock Deck
k this deck
55
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 103 flashcards in this deck.
Unlock Deck
k this deck
56
Sub procedures are automatically executed when events such as the user clicking a button occur.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
57
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 103 flashcards in this deck.
Unlock Deck
k this deck
58
The SelectedItem property of a ComboBox returns an integer indicating which choice is currently selected.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
59
The keyword End SubProcedure signifies the end of a Sub procedure.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
60
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 103 flashcards in this deck.
Unlock Deck
k this deck
61
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 103 flashcards in this deck.
Unlock Deck
k this deck
62
The Private keyword is required in a Function procedure declaration.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
63
You can pass no more than two arguments to a Sub procedure.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
64
A DivideByZeroException occurs when a value is divided by zero.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
65
The ____________________ property is used to return the string value of the selected choice in a ComboBox.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
66
A Function procedure can pass many values back to the calling procedure.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
67
If the Private keyword is omitted, the default option is Public.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
68
A Finally statement is required after each Catch block in a Try-Catch structure to execute any necessary cleanup code.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
69
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 103 flashcards in this deck.
Unlock Deck
k this deck
70
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 103 flashcards in this deck.
Unlock Deck
k this deck
71
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 103 flashcards in this deck.
Unlock Deck
k this deck
72
The ____________________ property is used to display a graphic on a splash screen.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
73
Only six different types of exceptions can occur in a Visual Basic program.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
74
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 103 flashcards in this deck.
Unlock Deck
k this deck
75
An opening screen that appears as an application is loading is called a(n) ----____________________ screen.
Unlock Deck
Unlock for access to all 103 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 103 flashcards in this deck.
Unlock Deck
k this deck
77
The ____________________ property of a ComboBox is assigned a number that represents the selected item.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
78
A Function procedure returns a single value to the calling procedure.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
79
In a Function procedure declaration, any lines of code after a Return statement will not be executed.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck
80
You cannot exclude the receiving variable in the procedure call.
Unlock Deck
Unlock for access to all 103 flashcards in this deck.
Unlock Deck
k this deck