BIS 228 Exam 2
The data that appears in a combo box when it is first displayed can be added to the combo box...
- Using the Form_Load procedure and the combo box items.Add method - During design time in the items Collection of the combo box
The SelectedIndex property of the first item in a list is ______
0
How many elements are contained in the array created with the following code? Dim EmoployeeString(25) As String
26
Declare an array and specify the number of elements using _____
A Dim statement
What is the key advantage of a .NET collection over an array?
A collection can be added to, deleted form, and cleared at run time, without declaring the maximum size of the collection while array must have a maximum size declared by a Dim or ReDim statement
_____ Can be used to find a specific value in an array
A table lookup
If you want to make sure that the focus is in the correct object when the form displays, you should write code in the forms ____ event
Activated
In order to add a template for a splash screen to a project, select _____ from the project menu
Add Windows Form and Add New Item
Which of the following is NOT true about passing arguments to procedures or functions? A. Specifying ByVal is not required when passing arguments B. Arguments may be passed ByVal or ByRef C. An argument that is passed ByRef cannot alter the original value D. If ByVal or ByRef is not specified, the argument will be sent by value
An argument that is passed ByRef cannot alter the original view
An array is a set of variables. Each individual variable is called ____ of the array
An element
A single execution of a group of instructions inside a Do/Loop is called ____
An iteration
What will add the work, monkey, to a list box names AnimalsListBox?
AnimalsListBox.Items.Add("monkey")
The _____ is found in the project properties, and contains the information about the program title, program version, programmer and company
Assembly information
Which property of a menu must be set to True if you want an item to have a check mark next to it when the project runs
Checked
If you need to have a form disappear and you want it removed from memory, you should use the ___ method
Close
The code to delete the selected item from ColorListBox is
ColorListBox.Items.RemoveAt (ColorListBox.SelectedIndex)
If you right-click an object, what type of menu pops up?
Context menu
Common dialog boxes ___
Display the predefined windows dialog boxes for open, save, fonts, and colors
What is the correct way to assign a font to a label using common dialog boxes after the statement FontDialog1.ShowDialog()
EmployeeLabel.Font = FontDialog1.Font
Which text box event occurs when a text box gets the focus?
Enter events
Immediately terminate integration in a For/Next loop with the _____ statement
Exit for
A function cannot have multiple arguments
False
A sub procedure returns a value to the point from which it was called
False
Code to create a user-defined Structure should be placed inside the procedure in which the structure will be used
False
Froms removed from a project by choosing "Exclude from project" from the "project" menu, are permanently deleted
False
If a list contains 15 items, the count property will be 15 and the highest SelectedIndex property will be 16
False
If the programmer adds a splash screen template to the project, it will automatically be displayed for 10 seconds when the program begins
False
If you click on the item in the menu that is grayed out, you will toggle it on, and it will appear in black text
False
If you decide to use the "Remove" method for an object, you will have to specify the index value as the parameter for the method
False
List boxes and combo boxes have a Text property that can be accessed at design time
False
Sub procedures and function procedures can return values to the point from which they were called
False
The Alphabetize property can be set to True and the combo or list box will automatically be sorted when an item is added to the list
False
The firm form a project displays is called the default form
False
The identifier for a loop index in the For/Next statement must be named LoopIndexInteger
False
The size of a collection must be declared before it can be used
False
The statement Dim CityName(10) as String defines an array with 10 elements
False
To add scroll bars to list boxes and combo boxes you must set the ScrollAlwaysVisible property to True
False
Variables declared as private must be qualified (by adding the form name where they are declared) if they are used in any other form
False
When an array is initialized with the Dim statement, the index starts at 1 instead of 0
False
When you use the Hide method on a particular form, the form will be removed from the screen and from memory
False
With multiple forms, the startup form must be names MainFrom
False
When you are working with an array the easier way to traverse the elements is to use the ____
For Each / Next Statement
What is the correct statement to declare a module-level variable that will keep track of the number of books sold at a school bookstore, and that will be available in order to display the total on a separate summary form?
Friend TotalBooksInteger As Integer
List boxes and combo boxes...
Hold a list of values
When is the counter incremented in a For/Next statement?
In the NEXT statement
When you have data stored in a StoredList, you can access the elements using the
Index and Key
What is not true about a menu item that has a check mark?
It is shown in gray
What is not true about a menu item that has a check mark? A. It can be toggled on and off B. It is currently selected C. It is shown in gray D. It can be deselected by changing its checked property to false
It is shown in gray
The sequence of Form Events
Load, Activated, Pain, Deactivate, FormClosing, FormClosed
Which statement about menus is NOT true?
Menu items are displayed in button controls at the top of the window
What is not true about using keyboard access with a menu item?
Menu items will not function at all if keyboard access is not assigned
When a form is displayed as _____ the use is prevented from accessing any other form, even if another form is visible
Modal
_____ can be used when two subscripts are needed to identify tabular data, such as when data is arranged in rows and columns
Multidimensional Arrays
The ability to define multiple subprograms or functions with the same name, but different signatures, in the same program is called _______
Polymorphism
Module-level variables declared as ____ are available only to the form in which they are declared
Private
Of the following is not a type of common dialog box?
Resizing windows
In the following statement ____ refers to the array: For Each OneSchoolingString in SchoolString
SchoolString
Which method is used to make all of the text in a text box appear selected?
SelectAll
Use the _____ to display a from as modeless
Show Method
The order and type of parameters that need to be passed to a subprogram or function procedure is known as the _______
Signature
Which of the following is not a type of common dialog box? A. color B. save file C. spell check D. open file
Spell Check
The first form of the project displays is called the ______
Startup Form
A VB programmer can combine multiple fields of related data using the ____
Structure Statement
The individual variables in an array are accessed by their ____ which is their position in the array
Subscript
Which property in a menu item's property window is used to change the words that will display in the menu?
Text
Please select the response that is true for the For/Next Loop?
The Next statement causes the <LoopIndex variable> to be incremented
What reflects good programming practice?
The scope of variables should be kept as narrow as possible; only give wider access by exception, if needed
If an exception is thrown and the message, "index was outside the bounds of the array." displays, this indicates ____
The subscript is a value greater than the upper subscript declared in the Dim statement for the array or The subscript value is less than zero
Which of the following statements about context menus is NOT true? A. A context menu can be assigned to a control by setting the control's ContextMenuStrip property B. You can assign the same context menu to more than one control on the form C. The user can access a context menu on a button by right-clicking it D. A program can have more than one context menu
The user can access a context menu on a button by right-clicking it
What is the effect of using the Static keyword to declare a variable
The variable is only initialized once, and retains its value when the procedure or block of code where it is declared is executed again
A table lookup is used to find a match for a specific value (or string) by comparing it to each element in an array
True
An array is a series of individual variables, all references by the same name but having unique indexes
True
Boolean variables are commonly referred to as switches or flags
True
For known number of iterations, the best option for a developer is to use a 'For/Next' look
True
If you want the user to be able to use the dialog boxes from the Windows environment so he can save files and change colors, you will need to add two common dialog component to your form, the SaveFileDialog for saving files, and the ColorDialog for changing colors
True
It is possible to create procedures that are not associated with click events
True
More than one subprogram or function in a program can have the same name, as long as the signature of each one is unique
True
Project properties specifies which form is the startup form, and which is the splash screen
True
The SelectedIndex property of a list box can be used as an array subscript to find the selected item in a list box
True
The ShowDialog method displays a form as modal and is a good choice when you need the user to respond to the form before continuing
True
The code, "NameLabel.Text = NameComboBox.Text" will display the selected name in NameLable
True
The default for passing arguments to function procedures and sub procedures is ByVal
True
The following code is valid: Dim NameString() As String = {"Theresa", "Anita", "Julia"}
True
The return value from a function is contained in a variable with the same name as the function
True
The structure / end structure statements may be used to represent a record of related fields of information
True
There are several collections defined in .NET to help programmers manage in-memory data
True
Use the code: NameListBox.SelectedIndex = -1 to deselect all items in a list
True
When adding a form from another project, you should copy the form's files into the project folder and then select "Add Existing item" from the "Project" menu
True
When an argument is sent ByVal, a copy of the arguments value is sent to the procedure so that the procedure cannot alter the original value
True
When copying form files from another project, only copy the files with the .vb files extension and VB will automatically copy the form files with the Designer.vb extension and the .resx extension
True
When creating menus with the MenuStrip component, the system creates a unique 'Name' property and you only change the 'Text' property that appears on the menu-bar
True
Write code in the form Activated event if you want to se the focus in the specific object when a form appears
True
What does the For/Next statement terminate iteration?
When executing the For statement, the counter must be greater than the final value