Final Exam VB
field
A ____ is a single item of information about a person, place, or thing.
repetition
A ____ structure is also referred to as a loop.
parameter
A __________ represents information that is passed to an event procedure when the event occurs.
combo
A ___________ box is similar to a list box in that it allows the user to select from a list of choices.
Text
A combo box's __________ property contains the value that appears in the text portion of the control.
TextChanged
A control's __________ event occurs when a change is made to the contents of a control's Text property.
AcceptButton
A default button is identified by setting the form's __________ property.
foreign key
A field that typically refers to a primary key in another table is called a ____.
FormClosing event
A form's __________ procedure is often used to verify that the user wants to exit the application.
Text
A form's __________ property specifies the text that appears in the form's title bar.
interface
A graphical user __________ is what the user sees and interacts with while an application is running.
table
A group of related records is called a ____.
FixedSingle
A label control that displays program output should use which BorderStyle setting?
8
A memory variable that stores a Double data type requires __________ bytes of storage.
Const
A named constant is created using the __________ statement.
accumulator
A numeric variable used to add together each employee's weekly gross pay is referred to as a(n) __________.
.sln
A solution file will have a(n) __________ file extension.
KeyPress
A text box's __________ event occurs each time the user presses a key while the control has the focus.
MaxLength
A text box's __________ property specifies the maximum number of characters the text box will accept.
index
A unique number called a(n) __________ identifies each item in a collection.
dataset
A(n) ____ is an electronic file that contains an organized collection of related information.
overflow
A(n) __________ error occurs when the value assigned to a memory location is too large for the location's data type.
sub procedure
A(n) __________ is a block of code that performs a specific task.
array
A(n) __________ is a group of variables that have the same name and data type, and are related in some way.
method
A(n) __________ is a predefined procedure that you can call (or invoke) when needed.
independent Sub procedure
A(n) __________ is not connected to any object or event, and it is processed only when a statement in your code calls (or invokes) it.
caption
According to GUI design guidelines, a meaningful __________ should be displayed on the face of each button.
three
According to the Windows standard, a list box should display a minimum of __________ item(s) at a time.
OpenText
After declaring a StreamReader variable, you can use the ____ method to open a sequential access file for input; doing this automatically creates a StreamReader object.
ReadLine
After opening a file for input, you can use the ____ method to read the next line of text from the file.
Results
After you click the Execute Query button in the Query Builder dialog box, the information retrieved by the query is displayed in the ____ pane of the dialog box.
class
All objects in an object-oriented program are instantiated (created) from a(n) __________.
Alt
An access key allows the user to select an object using the __________ key in combination with a letter or number.
Private Sub DisplayMessage(ByVal strItem As String, ByVal decPrice As Decimal)
An application allows a user to scan a bar code of an item to determine the item price. A message that contains the item name and the item price should display. You need to create a Sub procedure to display the message. Which procedure header should be used?
Private Function GetEndInventory(ByVal intBegin As Integer, ByVal intSales As Integer, ByVal intReturns As Integer) As Integer.
An application calculates an ending inventory amount based on a beginning inventory amount, sales, and returns. You need to create a function to calculate the ending inventory using three passed Integer variables: intBegin, intSales, and intReturns. Which procedure header should be used?
decTotal = decSubtotal + GetSalesTax(decSubtotal).
An application needs to calculate the total amount a customer owes, including sales tax. You decide to simplify the code by putting the sales tax calculation in a function. The returned value from the function should be added to the subtotal amount, and the result should be stored in the decTotal variable. Which statement will invoke the GetSalesTax function and return a value that can be used when calculating the total amount owed?
3
An array called strState() is declared as follows: Dim strState() As String = {"Ohio", "Michigan", "California", "Arizona"} What is the value of the subscript used to reference "Arizona"?g
four
An array is defined as follows: Dim intNumbers(3) As Integer How many elements does the array have?
GetUpperBound
An array's __________ method returns an integer that indicates the highest subscript in the specified dimension of the array.
Private
An independent Sub procedure's header usually begins with the keyword __________, which indicates that the procedure can be used only within the class that defines it.
Add
As you do with list boxes, you use the Items collection's __________ method to add an item to a combo box.
underscore (_)
Aside from letters and numbers, a variable name in Visual Basic can only contain the _________ character.
populating the array
Assigning initial values to an array is often referred to as __________.
12
Assume that a text box named txtPhoneNumber appears on a form and contains the phone number 414-555-5555. What value will the following statement assign to the intNumChars variable: intNumChars = txtPhoneNumber.Length?
75
Based on the code below, intScores(0, 0) is initialized to __________. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
25
Based on the code below, intScores(1, 1) is initialized to __________. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
23
Based on the code below, intScores(2, 0) is initialized to __________. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
56
Based on the code below, intScores(2, 1) is initialized to __________. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
6
Based on the code below, intScores(3, 0) is initialized to __________. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
12
Based on the code below, intScores(3, 1) is initialized to __________. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
btnExit
Based on the naming convention used in the book, which is an example of an appropriate name for a control?
If intSub >= 0 AndAlso intSub <= 2 Then
Based on the statement below, which If clause condition will evaluate to True when the intSub variable contains any valid subscript for the array but evaluate to False otherwise? Dim strColors() As String = {"red", "green", "blue"}
four
Case 1: BrainPower Tutoring The owner of BrainPower Tutoring needs an application that clients can use to request an appointment. The application should allow users to enter their name, subject, preferred appointment time, and phone number, and submit their request. It should also allow them to print their appointment request, clear the screen, and exit the application. The tutoring center has some clients with visual impairments, so the application should be easy for them to use. How many text boxes do you need for the application?
four
Case 1: BrainPower Tutoring The owner of BrainPower Tutoring needs an application that clients can use to request an appointment. The application should allow users to enter their name, subject, preferred appointment time, and phone number, and submit their request. It should also allow them to print their appointment request, clear the screen, and exit the application. The tutoring center has some clients with visual impairments, so the application should be easy for them to use. How many buttons do you need for the application?
Double
Case 1: PetPals You have been hired by PetPals Veterinary Clinic to modify its Bill Calculator application. Upon reviewing the application, you notice that all of the controls have their default names. You also notice that the Calculate button's code uses the properties of controls in the calculation statements. The total amount a customer owes for all of the services performed during an office visit may contain a decimal place. What data type is best for a variable that will store this value?
Private
Case 1: PetPals You have been hired by PetPals Veterinary Clinic to modify its Bill Calculator application. Upon reviewing the application, you notice that all of the controls have their default names. You also notice that the Calculate button's code uses the properties of controls in the calculation statements. Two procedures in the PetPals Clinic application need access to the same variable. You can accomplish this by declaring the variable using the __________ keyword in the form's declarations section.
relational
Comparison operators are also referred to as __________ operators.
binding
Connecting a field object from a dataset to a control on a form is called ____.
^
Consider the expression 3 * 2 ^ 2 < 16 + 5 AndAlso 100 / 10 * 2 > 15 - 3. Which operation is performed first?
AndAlso
Consider the expression 3 * 2 ^ 2 < 16 + 5 AndAlso 100 / 10 * 2 > 15 - 3. Which operation is performed last?
*
Consider the expression 3 * 2 ^ 2 < 16 + 5 AndAlso 100 / 10 * 2 > 15 - 3. Which operation is performed second?
4
Consider the following array: Dim intNumbers(,) As Integer = {{1,2},{3,4},{4,5},{6,7},{8,9}} What is the highest row subscript for the intNumbers array?
strSpecial(5) = "rigatoni"
Daily "Chef's Specials" are stored using two parallel one-dimensional arrays. The days of the week are stored in the strDays array, with Sunday as the first element. The daily special for each day is stored in a parallel array named strSpecial. Which statement assigns Friday's special, which is rigatoni, to the appropriate element?
unique
Each access key in an interface should be _____________.
instantiated
Each data type is a class from which a variable can be __________.
strDept = strEmpCode.Substring(1, 2)
Each employee is assigned an employee code, such as F01234, which is stored in the strEmpCode variable. The first character is a letter that indicates the employee's employment status (F for full-time, P for part-time). The next two characters are numbers that indicate the employee's department number. The last three characters are numbers representing a unique value for each individual employee. Which of the following statements assigns the employee's department to the strDept variable?
object
Each menu element is considered a(n) ____ and has a set of properties associated with it.
properties
Each object has a set of attributes, called __________, that determine the object's appearance and behavior.
SelectedIndexChanged
Each time either the user or a statement selects an item in a list box, the list box's SelectedValueChanged and __________ events occur.
TryParse
Every numeric data type in Visual Basic has a __________ method that can be used to convert a string to that particular data type.
Not
Except for the ____ operator, all of the logical operators allow you to combine two or more subconditions into one compound condition.
input
Files that are read by the computer are called ____ files.
one number less than
For a combo box's access key to work correctly, you must set its identifying label's TabIndex property to a value that is __________ the combo box's TabIndex value.
three
How many characters will be removed from the string below? Dim myString as String = "ABCDEFGH" myString = myString.Remove(2, 3)
three
How many styles of combo boxes are available in Visual Basic?
Decimal.TryParse(txtLateFee.Text, decLateFee)
If Option Strict is set to On, which statement will assign the contents of the txtLateFee control to a Decimal variable named decLateFee?
4
If a one-dimensional array contains five elements, its highest subscript is __________.
Enable Adding
If a user is not allowed to add a record, you should deselect the ____ check box on the DataGridView control's task list.
integer
If the digits argument is omitted, the Math.Round method returns a(n) __________.
strDailySpecial(2, 1) = "lasagna"
If the first row in the array contains Sunday as the day of the week, which statement assigns the daily special of lasagna to Tuesday?
False
If the intInventory variable contains the value 28, the condition in the If intInventory <= 25 Then clause will evaluate to ____.
True
If the intQuantity and decPrice variables contain the numbers 3 and 15.75, respectively, the condition in the If intQuantity > 0 AndAlso intQuantity < 10 OrElse decPrice > 20 clause will evaluate to __________.
greater than
If the stepValue in a For...Next statement is a positive number, the loop ends when the counter's value is __________ the endValue.
1
If the stepValue is omitted when coding a For...Next statement, a stepValue of __________ is used when the statement is executed.
7
If the strMsg variable contains the string "Happy New Year", what will the IndexOf method return in the following expression: strMsg.IndexOf("New")?
or
If the strState variable contains the string "North Dakota", what will the Substring method return in the following expression: strState.Substring(1,2)?
Alt
If you do not see the underlined access keys while an application is running, you can show them temporarily by pressing the __________ key.
TrimStart
If you need to remove characters from only the beginning of a string, you use the __________ method.
menu strip
In Visual Basic, you use a ____ control to add one or more menus to a Windows form.
StreamReade
In Visual Basic, you use a ____ object to read a stream of characters from a sequential access file.
StreamWriter object
In Visual Basic, you use a(n) ____ to write a stream of characters to a sequential access file.
button
In Windows applications, a(n) __________ is commonly used to perform an immediate action when clicked.
Shift
In Windows applications, pressing the __________ and Tab keys simultaneously will move the focus backward.
OK and Cancel
In Windows applications, which buttons do not typically have access keys assigned to them?
DefaultCellStyle
In a DataGridView control, you can format a bound column's data using the column's ____ property.
False
In a Do...Loop statement, the keyword While indicates that the loop instructions should be processed while the condition is false.
DropDownList
In a __________ combo box, the text portion is not editable.
inner, outer
In a nested repetition structure, one loop, referred to as the __________ loop, is placed entirely within another loop, called the __________ loop.
Return statement
In most cases, the last statement within a function is a(n)_________-.
1
In the mathematical expression 12 / 6 / 2, the answer is ____.
*
In the mathematical expression 4 * 3 + 15 / 3 - 6, which operation is performed first?
-
In the mathematical expression 4 * 3 + 15 / 3 - 6, which operation is performed last?
arithmetic, comparison, logical
In which order should operators always be evaluated?
address
Instead of passing a copy of a variable's value to a procedure, you can pass the variable's __________, which is its location in the computer's main memory.
Verb
It is a common practice to begin a procedure's name with a(n) __________.
diamond
Like the condition in a selection structure, a loop's condition in a flowchart is represented by a(n) __________.
0
Like the first item in a list box, the first item in a combo box has an index of __________.
Boolean
Logical operators are sometimes referred to as __________ operators.
decimal(5, 2)
MaidToOrder The database for a cleaning service company contains a table named tblCustomer. The table contains five fields pertaining to customer invoices. The InvoiceNum, CustomerNum, and InvoicePaid fields contain text. The InvoiceDate field contains dates. The InvoiceAmt field contains numbers that might be used in a calculation. Given the data in the tblCustomer table, which data type would you use for the InvoiceAmt field
relational databases
Most databases are created and manipulated using RDBMSs, and are called _____ because the information in them can be associated in different ways.
variables
Programmers can create __________, which are memory locations inside the computer, to temporarily store data while an application is running.
Name
Programmers use the ____ property of a menu element to refer to the menu element in code.
pseudocode
Short English-like phrases written to represent the steps a program must take to solve a particular problem are called ___________.
formatting
Specifying the number of decimal places and the special characters to display in a number is called _________.
the keyword Nothing
String variables are automatically initialized using __________.
True
T or F In a posttest loop, the "5" in the following condition specifies when to continue: Loop While intNum <= 5
False
T or F: A Boolean variable is initialized to the value True if no initial value is stated when the variable is declared.
False
T or F: A Function procedure does not return a value after performing its assigned task.
True
T or F: A check box's CheckedChanged event occurs when the value in its Checked property changes.
True
T or F: A check digit is used on a credit card number, a bank account number, a product's UPC (Universal Product Code), and a book's ISBN (International Standard Book Number).
True
T or F: A class-level array may be appropriate if two procedures need access to the same array.
True
T or F: A counter is always incremented by a constant value.
False
T or F: A data form typically does not provide text boxes for entering data; they must be added manually.
False
T or F: A database file contained in a project is referred to as a logic database file.
True
T or F: A field that is a primary key should never be empty.
True
T or F: A function's header includes the As dataType section, which specifies the data type of the value the function will return.
False
T or F: A literal type character forces a literal constant to assume a data type other than the one its form indicates.
True
T or F: A loop that has no way to end is called an infinite loop.
True
T or F: A programmer must phrase a selection structure's condition so that it results in either a true or a false answer only.
True
T or F: A relational database can contain one or more tables.
True
T or F: A sales report, a memo, and an employee list are examples of text stored in a sequential access file.
True
T or F: A simple variable is unrelated to any other variable in memory.
True
T or F: A single-alternative selection structure requires one or more actions to be taken only when its condition is true.
False
T or F: A source file with a .vb file name extension contains a list of projects in a solution.
True
T or F: A two-dimensional array resembles a table in that the variables (elements) are in rows and columns.
False
T or F: A variable declared in the declarations section of a form is called a procedure-level variable.
True
T or F: A variable declared using one of the numeric data types is automatically initialized to the number 0.
False
T or F: A variable is a computer memory location where a programmer can permanently store an item of data while an application is running.
True
T or F: Access keys are not case sensitive.
True
T or F: Accumulators are usually initialized to 0, whereas counters are initialized to either 0 or 1.
True
T or F: Actions performed by the user such as clicking, double-clicking, and scrolling are known as events.
False
T or F: All controls have a TabIndex property.
False
T or F: All menu titles in an application can share a single access key
True
T or F: All of the data in an array must have the same data type.
True
T or F: Although you can create many levels of submenus, it is best to use only one level in your application because including too many layers of submenus can confuse the user.
True
T or F: An advantage of using the For Each...Next statement to process an array is that your code does not need to keep track of the array subscripts or even know the number of array elements.
False
T or F: An event procedure is a Function procedure that is associated with a specific object and event.
True
T or F: An independent Sub procedure is processed only when a statement in your code calls it.
True
T or F: An object created from a class is called an instance of the class and is said to be instantiated from the class.
True
T or F: At times, you might need to use the Items collection's Add method (rather than the String Collection Editor) to add items to a list box.
True
T or F: Before using a string in a comparison, you can use either the ToUpper method or the ToLower method to convert the string to uppercase or lowercase, respectively, and then use the converted string in the comparison.
True
T or F: By default, an event procedure's name is composed of the object's name followed by an underscore and the event's name.
True
T or F: Calculations involving Decimal variables are not subject to the small rounding errors that may occur when using Double variables.
True
T or F: Comparison operators are always evaluated after arithmetic operators in a conditional expression.
True
T or F: Ctrl+C and Ctrl+S are used as shortcut keys for the Copy command on an Edit menu and the Save command on a File menu, respectively.
True
T or F: Each character in a character array, or string, has a unique index that represents its position in the string.
False
T or F: Each column in a table represents a record and each row represents a field.
True
T or F: Each namespace contains the code that defines a group of related classes.
False
T or F: Each parameter stores an item of data that it receives from the calling statement's argumentList.
False
T or F: Each variable in an array has a different name and data type.
False
T or F: Even if none of a label control's events will be coded and it will not be referred to in code, you should change its name from the default value.
False
T or F: Every text box's KeyPress event procedure needs to be coded.
False
T or F: Files to which information is written are called input files.
False
T or F: If a one-dimensional array contains five elements, its Length property contains the number 5 but its highest subscript is 3.
True
T or F: If a table object's control type is changed from DataGridView to Details, the computer automatically provides appropriate controls.
True
T or F: If an application expects the user to enter a seven-digit phone number or a five-digit ZIP code, the application's code should verify that the user entered the required number of characters.
False
T or F: If you are going to include color in an interface, limit the number of colors to four, not including white, black, and gray.
True
T or F: If you do not take deliberate steps in your code to handle exceptions, Visual Basic "handles" them for you
False
T or F: In a Do...Loop statement, a condition can be phrased as either a looping condition or a loop enter condition.
False
T or F: In a pretest loop, the evaluation of the condition occurs after the instructions within the loop are processed.
True
T or F: In a well-designed user interface, each control that can accept user input or respond to the user's action has an access key assigned to it.
True
T or F: In addition to getting data from the keyboard and sending data to the computer screen, an application can also get data from and send data to a file on a disk.
True
T or F: In addition to using the Do...Loop and For...Next statements to code a loop, you can also use the For Each...Next statement.
True
T or F: In most cases, an identifying label should consist of one to three words only and appear on one line.
True
T or F: It is best to use black text on a white, off-white, or light gray background.
True
T or F: It is rare for the controls to be added to the form in the correct tab order.
False
T or F: It is uncommon for programmers to associate the items in a list box with the values stored in an array.
True
T or F: Like the condition in a selection structure, the condition in a loop must evaluate to either True or False.
True
T or F: Menu title captions should be one word only, with only the first letter capitalized.
True
T or F: Most databases are created and manipulated using relational database management systems.
True
T or F: Most times you will use the Dim statement to declare a variable within the procedure that needs it.
True
T or F: One-dimensional arrays are often used to accumulate related values; these arrays are commonly referred to as accumulator arrays.
True
T or F: Pressing a button's access key invokes the button's Click event.
False
T or F: Procedure-level variables are typically declared at the end of a procedure.
True
T or F: Programmers use the repetition structure when they need the computer to repeatedly process one or more program instructions.
True
T or F: Radio buttons allow you to limit the user to only one choice from a group of two or more related but mutually exclusive options.
True
T or F: Some procedures require a selection structure that can choose from several different alternatives. Such selection structures are referred to as multiple-alternative selection structures.
False
T or F: Storing data in an array decreases the efficiency of your code.
True
T or F: Tab order is the order in which each control receives the focus when the user presses the Tab key.
False
T or F: The AndAlso operator does not always evaluate the second condition.
True
T or F: The Data Source Configuration Wizard allows you to specify the data you want to access from the file.
True
T or F: The Double.TryParse and Decimal.TryParse methods can convert a string that contains leading or trailing spaces.
True
T or F: The Integer.TryParse method can be used to convert an amount read from a sequential access file to the Integer data type.
False
T or F: The Math.Round method can be used with a single argument to round amounts to two decimal places.
False
T or F: The Not operator would make a True statement False, but would not make a False statement True.
True
T or F: The PasswordChar property hides the user's entry by displaying a replacement character, such as an asterisk, in place of the character the user entered.
True
T or F: The Peek method looks ahead into the file to determine whether the file contains another character to read.
True
T or F: The Project Designer window allows you to verify the form that will display when the application starts.
False
T or F: The Properties window lists the names of the files included in the application you are creating.
False
T or F: The ReadToEnd method reads the next line of text in a sequential access file.
False
T or F: The Remove method is used to remove characters only from the end of a string.
False
T or F: The Remove method removes characters from the original string.
True
T or F: The characters in most input and output files are both read and written in consecutive order, one character at a time, beginning with the first character and ending with the last character.
False
T or F: The computer can retrieve data stored in a relational format both quickly and easily, but the data must be displayed in a specific order.
True
T or F: The condition in a loop can appear at either the top or the bottom of the loop.
True
T or F: The expression 12 > 0 AndAlso 12 < 10 * 2 evaluates to True.
False
T or F: The first step in planning a Windows Forms application is to sketch the user interface.
True
T or F: The main memory of a computer is called random access memory or, more simply, RAM.
False
T or F: The most common control used to enter a password is a label control.
True
T or F: The most commonly used properties for a menu element are the Name and Text properties.
False
T or F: The names of the arguments in a statement that calls (or invokes) a procedure need to be identical to the names of the corresponding parameters.
True
T or F: The number of arguments listed in the calling (invoking) statement's argumentList should agree with the number of parameters listed in the parameterList in the procedure header.
True
T or F: The startValue, endValue, and stepValue items in the For clause control the number of times the loop body is processed.
False
T or F: The text contained in a label control that identifies another control's contents should be right-aligned within the label, according to Windows standards.
True
T or F: The value stored in a named constant cannot be changed while the application is running.
True
T or F: The variables in an array are stored in consecutive locations in the computer's main memory.
True
T or F: To bind label and text box controls, you use the DataBindings/Text property
False
T or F: To generate random numbers, you first need to create a Random object to represent the pseudo-random number generator.
True
T or F: Visual Basic provides the Replace method for replacing a sequence of characters in a string with another sequence of characters.
True
T or F: Visual Basic's String data type is associated with two SQL Server data types: char(n) and varchar(n).
True
T or F: When inside an application, you can press Alt+f to open the File menu and then tap the letter x to select the Exit option, which ends the application.
True
T or F: When processing the PadLeft and PadRight methods, the computer makes a temporary copy of the string in memory, and then inserts the characters in the copy only.
False
T or F: When the code for a selection structure in Visual Basic runs, the code that follows the Else clause will be executed when the condition is true.
False
T or F: When working in Visual Basic's designer window to modify a menu, you click Table to add a separator bar (horizontal line).
True
T or F: When you declare a variable in the For clause, the variable has block scope and can be used only within the For...Next loop.
True
T or F: When you drag an object from a dataset in the Data Sources window to an empty area on the form, the computer creates a control and automatically binds the object to it.
True
T or F: When you drag an object from a dataset in the Data Sources window to an existing control, the computer does not create a new control; rather, it merely binds the object to the existing control.
False
T or F: When you select a radio button, its Checked property changes from True to False, invoking its CheckedChanged event.
False
T or F: You can determine whether a variable is being passed by value or by reference by looking at the statement that calls (invokes) the procedure.
True
T or F: You can drag the vertical lines in the column headers to adjust a column's width.
False
T or F: You can eliminate the problems that occur as a result of implicit type conversions by entering the Option Explicit On statement above the Public Class clause in the Code Editor window.
False
T or F: You can include an identifying label on a group box by setting the group box's Identity property.
True
T or F: You can make a list box any size you want, but you should follow the Windows standard.
False
T or F: You can use a string's Value property to determine the number of characters it stores.
True
T or F: You can use the arithmetic assignment operators to abbreviate an assignment statement that contains an arithmetic operator.
True
T or F: You deactivate a control by setting its Enabled property to False, and you activate it by setting its Enabled property to True.
False
T or F: You should assign shortcut keys to every menu item.
True
T or F: You usually declare an array using one of the following keywords: Dim, Private, or Static.
False
T or F: in a one-dimensional array, one variable is distinguished from another using a unique number called an element.
True
T or F; An argument in a calling statement can be a literal, a named constant, a keyword, or a variable.
ControlChars.Back
The Backspace key is represented by the __________ constant.
bound controls
The BindingSource object provides the connection between the DataSet and the ____ on the form.
advance the insertion point to the next line in a control
The ControlChars.NewLine constant instructs the computer to ___________.
strEmpCode = strEmpCode.Remove(1, 2) strEmpCode = strEmpCode.Insert(1, "09")
The HR department has decided to change the finance department number from 04 to 09. If the strEmpCode variable contains the code for a finance department employee, which statement correctly changes the contents of the variable?
SQL (Structured Query Language)
The Query Builder dialog box creates queries using a language called ____.
CDE
The Remove method in the following code will remove which characters from the myString variable? Dim myString as String = "ABCDEFGH" myString = myString.Remove(2, 3)
one number less than the TabIndex value assigned to the text box itself
The TabIndex value assigned to a text box's identifying label must be __________ for the text box's access key to work correctly.
database to the DataSet object
The TableAdapter object connects the ____ .
tools you use when creating your application's interface
The Toolbox window displays __________.
TableAdapterManager
The ____ can be used to save any changes made to the data contained in the DataSet to the database.
Peek
The ____ method returns the number -1 (a negative 1) when a sequential access file (opened for input) does not contain another character to read.
WriteLine
The ____ method writes a newline character after the data in a sequential access file.
TableAdapter
The ____ object is responsible for retrieving the appropriate information from the database and storing it in the DataSet.
BindingSource
The ____ object provides the connection between the DataSet and the bound controls on the form.
Try...Catch
The ____ statement is used for exception handling in a procedure.
diamond
The _________ symbol in a flowchart represents the condition in a selection structure.
Like operator
The __________ allows you to use pattern-matching characters to determine whether one string is equal to another string.
PadLeft
The __________ method inserts the padded characters at the beginning of a string, which right-aligns the characters within the string.
PadRight
The __________ method pads the string on the right, which inserts the padded characters at the end of the string and left-aligns the characters within the string.
Contains
The __________ method performs a case-sensitive search that returns the Boolean value True when the subString is contained anywhere in the string.
IndexOf
The __________ method returns an integer that represents the subString argument's starting position within the string.
Like
The __________ operator evaluates to True when the string matches the pattern; otherwise, it evaluates to False.
oval
The __________ symbol indicates the beginning and end of a flowchart.
parallelogram
The ___________ symbol in a flowchart represents input tasks and output tasks.
rectangle
The ___________ symbol in a flowchart represents tasks such as ending the application and making calculations.
strEmpCode.ToUpper Like "F*"
The application needs to process benefits for full-time employees only. Which expression evaluates to True when a full-time employee's code is stored in the strEmpCode variable? The code contains one letter (either P or F) followed by five numbers.
record
The combination of related fields creates a(n) ____.
258.75
The dblMiles variable contains the number 575 before the code below is processed. What value will be in the variable after the code is processed? If dblMiles >= 500 Then dblMiles = dblMiles * 0.45 Else dblMiles = dblMiles * 0.25 End If
DropDown
The default combo box style in Visual Basic is __________.
287.88
The expression Math.Round(287.876, 2) yields a value of __________.
foreign key
The field used to link a child table to a parent table is known as the ____.
index
The first argument in the Insert method's syntax is an integer that specifies a character's position in a string. The integer is called the character's _________.
The While keyword should be used instead of the Until keyword.
The following code in an XYZ Solutions program is not working properly. The code should display the intCounter variable's value, but only when the value is less than or equal to 15. What mistake did the previous programmer make? Dim intCounter As Integer intCounter = 1 Do Until intCounter <= 15 lblMsg.Text = lblMsg.Text & intCounter.ToString & ControlChars.NewLine intCounter += 1 Loop
0
The following statement will declare a one-dimensional String array. What is the subscript for the first element?Dim strLakes(5) As String
six
The following statement will declare an array that has __________ elements. Dim intAreas(5) As Integer
determine how the user and the application will provide their respective items
The fourth step in the planning process is to __________.
posttest
The instructions in which type of loop will always be processed at least once?
cell
The intersection of a row and a column in a DataGridView control is called a ______.
ForeColor
The label control property that specifies the color of the text inside the control is called the __________ property.
draw a sketch of the user interface
The last step in planning a Windows Forms application is to __________.
pretest
The loop created by the For...Next statement is a __________ loop.
Trim
The method that removes space or other characters from both ends of a string is the __________ method.
SelectionMode
The number of choices the user can select from a list box is controlled by the list box's ____ property.
outFile.Close()
The outFile variable stores a StreamWriter object and is associated with the pictureFrame57.txt file. Which statement will close the file, ensuring that the data is saved and making the file available for use elsewhere in the application?
StartPosition
The position of the form on the screen when an application first starts is controlled by setting the __________ property.
label
The purpose of a __________ control is to display text that the user is not allowed to edit while the application is running.
separator bar
The purpose of a(n) ____ is to visually group together related items on a menu or submenu.
strCities(0) = "Madrid"
The statement __________ assigns the string "Madrid" to the first element in the strCities array.
lblFullName.Text = strLastName & ", " & strFirstName
The strFirstName and strLastName variables contain the strings "Jane" and "Jones," respectively. Which statement will display the string "Jones, Jane" (the last name, a comma, a space, and the first name) in the lblFullName control?
If strPassword.ToUpper Like "[A-Z][A-Z][A-Z][A-Z][A-Z][A-Z]##" Then
The strPassword variable contains eight characters. Which If clause can be used to verify that the password contains six letters followed by two numbers?
If strPhone.Contains("-") = True Then
The strPhone variable should contain only numbers and no dashes (-). An error message should display if there is a dash anywhere in the variable. Which If clause conditions will evaluate to True when the variable contains a dash?
strRate(2)
The strRoom and strRate arrays are parallel arrays. If Deluxe is stored in the third element in the strRoom array, where is its rate (115) stored?
Decimal.TryParse(txtSales.Text, decSales(2))
The syntax __________ assigns either the value entered in the txtSales control (converted to Decimal) or the number 0 to the third element in the decSales array.
object.Focus()
The syntax of the method that can be used to move the focus to a control during run time is __________.
{Dim|Private} streamWriterVariableName As IO.StreamWriter.
The syntax used to declare a StreamWriter variable is ____.
left-aligned
The text contained in a label control that identifies another control's contents should be meaningful and __________ within the label.
strSalary = txtSalary.Text.TrimStart("$"c)
The txtSalary control contains a dollar sign followed by the number 750. Which statement will assign only the number 750 to the strSalary variable?
Replace
The users of the HR application have entered some employee social security numbers (SSNs) with dashes (such as 222-33-4444) and some without dashes (such as 222334444). You need to remove all of the dashes from any SSN that contains dashes. The SSNs are always stored in a variable named strSocial. You will use the __________ method to edit the code so that only numeric characters are stored in the strSocial variable.
Copy to Output Directory
The way Visual Basic saves changes to a local database file is determined by the file's ____ property.
Format
To align two or more selected controls along their left, right, top, or bottom borders, you would use the __________ menu.
Array.Sort
To arrange the values in a one-dimensional array in ascending order, you use the __________ method.
tblCustomer
To create a DataGridView control on the form, you would click on the ____ object in the Data Sources window and drag it to the form.
Insert
To insert characters within a string, you use the __________ method.
Lock Controls
To keep you from inadvertently moving controls as you work in the IDE, click the form or control, then click the __________ option in the Format menu.
KeyChar
To prevent a text box from accepting inappropriate characters, you first use the e parameter's __________ property to determine the key that the user pressed.
TrimEnd
To remove characters from only the end of a string, use the __________ method.
Sorted
To sort the items in the list portion of a combo box, you use the combo box's __________ property.
To
To specify a range of values in a Select Case statement's Case clause, use the _______ keyword when you know both the upper and lower values in the range.
Is
To specify a range of values in a Select Case statement's Case clause, use the _______ keyword when you know only one end of the range.
Debug
To start an application using the menu bar, you click __________ on the menu bar and then click Start Debugging.
Solution Explorer
To verify that a solution has been closed, you can look in the __________ window.
True
True or False: A class definition is a block of code that specifies or defines an object's appearance and behavior.
True
True or False: If you change your default environment settings after configuring Visual Studio, you will need to perform the configuration steps again.
True
True or False: The Auto Hide button allows you to hide windows that you are not currently using.
True
True or False: The Windows standard is to use sentence capitalization for identifying labels.
parallel
Two or more arrays whose elements are related by their positions in the arrays are referred to as __________ arrays.
variable
Usually, the statement that invokes a function will assign the function's return value to a(n) ____.
Substring
Visual Basic provides the __________ method for accessing any number of characters contained in a string.
Financial
Visual Basic's built-in __________ class contains many methods that your applications can use to perform financial calculations.
a list of the projects contained in the current solution
What does the Solution Explorer window display?
True
What is the value of the expression 9 * 2 - 8 > 5 + 2 / 2?
statements
What term is used for instructions that are processed (executed) by the computer?
decrementing
What term is used for the process of adding increments of a negative number?
?? incrementing ??
What term is used to describe assigning a beginning value to a counter or an accumulator?
Click
When a button is selected, the computer processes the code contained in the button's __________ event procedure.
Checked
When a check box is selected, its __________ property contains the Boolean value True; otherwise, it contains the Boolean value False.
the most commonly used button
When a group of buttons is organized based on Windows standards, which button will appear first?
BindingNavigator
When an application is running, you can use the ____ control to move from one record to the next in the dataset, as well as to add or delete a record and save any changes made to the dataset.
exe
When an application is started, Visual Basic will automatically create a file that has the project name and a(n) __________ file extension.
"threw an exception"
When an error occurs in a procedure's code during run time, programmers say that the procedure ____.
Message property
When an exception occurs in the Try block's code, a description of the exception is stored in the ____________ of the Catch block's ex parameter.
dot member access operator
When an object is selected, the __________ that appears in the Object box indicates a hierarchy of namespaces, and it allows the computer to locate the object's class in a computer's main memory.
KeyChar
When coding the KeyPress event procedure, use the e parameter's __________ property to cancel the key if it is an inappropriate one.
two
When designing an interface, you should use no more than ____________ different font sizes.
{ }
When initializing an array in its declaration statement, the initialValues portion of the statement is enclosed in __________.
Pascal case
When using __________, you capitalize the first letter in the procedure name and the first letter of each subsequent word in the name.
dialog box opens
When you click the ellipsis (...) button in the Settings box of the Font property, a(n) __________.
value
When you pass a variable by __________, the computer passes only a copy of the variable's value to the receiving procedure.
Exit button's Click
When you want the application to end when the user clicks the Exit button, you write the Me.Close() statement in the __________ event procedure.
If IO.File.Exists("accounts.txt") Then
Which If clause can be used to determine whether the accounts.txt file exists?
If IO.File.Exists("inventory.txt")
Which If clause can be used to determine whether the inventory.txt file exists?
If strState.ToUpper Like "[A-Z][A-Z]" Then
Which If clause can be used to verify that the strState variable contains a two-letter state ID?
If IO.File.Exists("pictureFrame.txt") Then
Which If clause should be used before opening the pictureFrame.txt input file?
&Calculate
Which assigns the letter C as the Calculate button's access key?
Dim intSub As Integer Dim intHighSub As Integer =strToppings.GetUpperBound(0) Do While intSub <=intHighSub MessageBox.Show(strToppings(intSub)) intSub += 1 Loop
Which block of code will process its loop body for each element in the strToppings array, which contains 14 elements with subscripts of 0 through 13?
*
Which character on the designer window's tab indicates that a change was made to the form since the last time it was saved?
The conditions in all of the other choices would evaluate to True.
Which condition will evaluate to True when the intPackages variable contains the value 100?
text box
Which control provides an area in the form where the user can enter data?
Double
Which data type can store a number containing a decimal place?
char(1)
Which data type would you use for the InvoicePaid field in the tblCustomer table?
strProducts(0, 0)
Which expression refers to the element located in the first row, first column in a two-dimensional array named strProducts?
a label control that displays program output
Which form element typically has its AutoSize property set to False?
F5
Which function key will start an application?
Return dblNumber
Which is a valid Return statement?
LabelSize
Which is not a commonly used property of a label control?
The SQL statement appears in the Query pane.
Which is not true regarding the Query Builder dialog box?
check digit
Which is often added to either the beginning or the end of a number to validate the number's authenticity?
<>
Which is the "not equal to" operator in Visual Basic?
Dim inInventory As IO.StreamReader
Which is the correct declaration statement for a procedure-level variable named inInventory that will be used to read data from a sequential access file?
string.Insert(startIndex, value)
Which is the correct syntax for the Insert method?
shortcut
Which keys appear to the right of a menu item and allow the user to select an item without opening the menu?
AutoSize
Which label control property determines whether the control automatically sizes to fit its current contents?
For Each...Next
Which loop allows you to traverse an array without having to specify the highest array subscript?
IsfieldNull
Which method determines whether the field contains the NULL value?
Random
Which object is used to represent the pseudo-random number generator in Visual Basic?
outFile = IO.File.CreateText("F:\employee.txt")
Which of the following opens the employee.txt file for output, creates a StreamWriter object, and assigns the object to the outFile variable?
*
Which operator is evaluated first in the expression 9 * 2 - 8 > 5 + 2 / 2?
>
Which operator is evaluated last in the expression 9 * 2 - 8 > 5 + 2 / 2?
TabIndex
Which property determines the order in which each control receives the focus?
Description
Which property is not a commonly used property of a text box?
TextAlign
Which property of a control is used to specify the position of the text within the control?
Identify the application's purpose, identify the items that the user must provide, identify the items that the application must provide, determine how the user and the application will provide their respective items, and draw a sketch of the user interface.
Which sequence for the five steps for planning a Windows Forms application is correct?
The interface should be designed using black text on a white background.
Which statement about user interface design is true?
decSubtotal += decPrice
Which statement adds the number stored in the decPrice variable to the number stored in the decSubtotal variable, and then assigns the result to the decSubtotal variable?
strGrade = txtGrade.Text.ToUpper.
Which statement assigns the contents of the txtGrade control, in uppercase, to the strGrade variable?
intNumbers(1) = 20
Which statement assigns the number 20 to the second element in a one-dimensional Integer array named intNumbers?
strCities(0, 1) = "Paris"
Which statement assigns the string "Paris" to the element located in the first row, second column in the strCities array?
dblNewPrice = GetNewPrice(dblCurrentPrice)
Which statement assigns the value returned by the GetNewPrice function to a variable?
Dim dblAverage As Double
Which statement declares a Double variable named dblAverage?
Private strToppings(13) As String
Which statement declares a class-level one-dimensional array named strToppings that has 14 elements to store the 14 available pizza toppings? (The statement will be entered in the form class's declarations section.)
Dim inFile As IO.StreamReader
Which statement declares a variable that can be used to open an input file?
lblNewPrice.Text = GetNewPrice(dblCurrentPrice).ToString("C2")
Which statement displays the value returned by the GetNewPrice function?
lblPay.Text = dblPay.ToString("C0")
Which statement formats the contents of the dblPay variable with a dollar sign and no decimal places?
DisplayMessage(strItemName, decItemPrice)
Which statement invokes the DisplayMessage Sub procedure?
intEnd = GetEndInventory(intBegInv, intItemsSold, intReturned)
Which statement invokes the GetEndInventory function and assigns the function's return value to the intEnd variable?
A button's Text property determines the text that appears on the button's face
Which statement is true?
The Text property stores the menu element's caption, which is the text that the user sees when working with the menu.
Which statement is true?
Private dblHeight As Double
Which statement should be used to declare a class-level variable?
outFile.Close()
Which statement will close the sequential access file associated with the outFile variable?
cboDepartment.Items.Count
Which statement will determine the number of items in the list portion of the combo box named cboDepartment?
inFile.ReadLine
Which statement will read data from a sequential access file?
outFile.Write("Programming")
Which statement will write the text "Programming" (without the quotes) to a sequential access file?
=
Which symbol is used in code to assign a value to an existing variable?
^
Which symbol is used to represent exponentiation (raising a number to a power) in a calculation?
solution
Which term is used for a container that stores the projects and files for an entire application?
font
Which term is used for the general shape of the characters the text displayed on a form?
counter-controlled
Which type of loop would you use to process loop instructions a precise number of times?
designer
Which window allows you to create a graphical user interface?
CharacterCasing
While the text is being entered into the text box, which is used to specify whether the text should remain as typed or be converted to either uppercase or lowercase?
add the database file as a new data source
You are responsible for connecting the database that contains the tblCustomer table to an application. You must first use the Data Source Configuration Wizard to ____.
parameters
You can associate a procedure with more than one object and event as long as each event contains the same __________ in its procedure header.
Stop
You can stop an infinite loop by clicking Debug on the menu bar, and then clicking the __________ Debugging option.
Properties
You can tell whether a control has a TabIndex property by viewing its ____________ list.
parentheses
You can use __________ to override the arithmetic order of precedence.
list box
You can use a __________ to display a list of items from which the user can select zero or more items.
Focus
You can use a control's __________ method to move the focus to the control during run time.
Sorted
You can use a list box's __________ property to sort (organize) the data contained in a sequential access file.
Length
You can use a one-dimensional array's ________ property to determine the number of elements in the array.
group box
You can use a(n) __________ control to visually separate related controls from other controls on the form.
SelectedIndex
You can use either the SelectedItem property or the __________ property to select the default list box item from code.
Data Source Configuration
You can use the ____ Wizard to connect an application to a database file.
AppendText
You can use the ____ method to open a sequential access file for append.
CreateText
You can use the ____ method to open a sequential access file for output.
Contains
You can use the __________ method to search a string to determine whether it contains a specific sequence of characters.
The intCounter += 1 statement, which updates the intCounter variable within the loop, needs to be removed.
You changed the Do clause to the correct For clause in the previous problem. You also changed the Loop keyword to the Next keyword for the For...Next loop. What else needs to be changed about the Do loop?
Private
You declare a class-level variable using the __________ keyword.
Code Editor
You enter a procedure's code in the __________ window.
lblTax.Text = dblTax.ToString("C2")
You have been hired by PetPals Veterinary Clinic to modify its Bill Calculator application. Upon reviewing the application, you notice that all of the controls have their default names. You also notice that the Calculate button's code uses the properties of controls in the calculation statements. Which statement assigns the contents of the dblTax variable, formatted with a dollar sign and two decimal places, to the lblTax control?
frmRidgeline
You have been hired to develop an application for Ridgeline Realty, a local real estate agency. The owner wants the application to display an image of the company logo and to say "Ridgeline Realty" in the title bar. You will use the most common properties of a picture box to complete the project. According to the naming convention used in the book, an example of a valid value for the form's Name property is __________.
picture box
You have been hired to develop an application for Ridgeline Realty, a local real estate agency. The owner wants the application to display an image of the company logo and to say "Ridgeline Realty" in the title bar. You will use the most common properties of a picture box to complete the project. To add the image of the company logo, you must first add a __________ control in which to display it.
create a new project and determine the directory for the application
You have been hired to develop an application for Ridgeline Realty, a local real estate agency. The owner wants the application to display an image of the company logo and to say "Ridgeline Realty" in the title bar. You will use the most common properties of a picture box to complete the project. To create the Windows application for Ridgeline, you will first need to __________.
Text
You have been hired to develop an application for Ridgeline Realty, a local real estate agency. The owner wants the application to display an image of the company logo and to say "Ridgeline Realty" in the title bar. You will use the most common properties of a picture box to complete the project. To make sure the title bar displays the text that Ridgeline Realty has requested, enter it into the form's __________ property.
SizeMode
You have been hired to develop an application for Ridgeline Realty, a local real estate agency. The owner wants the application to display an image of the company logo and to say "Ridgeline Realty" in the title bar. You will use the most common properties of a picture box to complete the project. Which property is used to specify how the image in a picture box is displayed?
Dim strDailySpecial(6, 1) As String
You have decided that the daily "Chef's Specials" need to be stored in a two-dimensional array rather than two parallel one-dimensional arrays. When entered in a procedure, which of the following statements declares a procedure-level array named strDailySpecial? The number of rows is based on the number of days in the week. Each row will store the name of the day (for example, Sunday) and the name of that day's special.
declare a StreamReader variable for the input file
You need to create a report using the pictureFrame.txt sequential access file. The report should contain a list of all picture frames with a size of 5×7. The report will be saved to another sequential access file named pictureFrame57.txt. Your first step is to ____.
The Enable Adding check box on the DataGridView control's task list must be selected
You need to make sure the user of the application can add records to, but not delete records from, the dataset. Which of the following needs to be performed?
graphical user interface (GUI) guidelines
You should adhere to the Windows standards when designing an interface because that consistency will give your interface a familiar look, which will make your application easier for users to learn and use. These guidelines are referred to as __________.
Close
You should use the ____ method to close a sequential access file as soon as you are finished using it.
procedure
You tell an object how to respond to an event by writing an event __________, which is a set of Visual Basic instructions that are processed only when the event occurs.
picture
You use a(n) __________ box to display an image on a form.
&
You use the ____ operator to concatenate strings.
Both If strMember <> "Y" Then and If strMember = "N" Then.
You've been asked to design an application that will process the transactions for Jack of All Trades, which rents small power equipment to commercial and residential customers. The strCustomer variable will be used to determine whether a customer is commercial (C) or residential (R). Commercial customers receive a 10% discount if they are members of the Rental Rewards Program. Residential customers receive a 5% discount if they are members. The strMember variable will be used to determine whether the customer is (Y) or is not (N) a member of the Rental Rewards Program. The application needs to display a message that reminds the clerk to ask customers to join the Rental Rewards Program when they check out. This message should only display if the customer is not currently in the program. Which If clause would evaluate to True and display the reminder message for the clerk?
dual-alternative selection structure
You've been asked to design an application that will process the transactions for Jack of All Trades, which rents small power equipment to commercial and residential customers. The strCustomer variable will be used to determine whether a customer is commercial (C) or residential (R). Commercial customers receive a 10% discount if they are members of the Rental Rewards Program. Residential customers receive a 5% discount if they are members. The strMember variable will be used to determine whether the customer is (Y) or is not (N) a member of the Rental Rewards Program. The message provided when a customer is not a current member of the Rental Rewards Program is "Enroll this customer in the Rental Rewards Program?" The clerk can click "Yes" to begin the application process, or "No" to enter a note that the customer has declined the offer. What type of selection structure is used to accomplish this?
If strCustomer = "C" AndAlso strMember = "Y"
You've been asked to design an application that will process the transactions for Jack of All Trades, which rents small power equipment to commercial and residential customers. The strCustomer variable will be used to determine whether a customer is commercial (C) or residential (R). Commercial customers receive a 10% discount if they are members of the Rental Rewards Program. Residential customers receive a 5% discount if they are members. The strMember variable will be used to determine whether the customer is (Y) or is not (N) a member of the Rental Rewards Program. Which If clause would evaluate to True and apply the 10% discount for a commercial customer who is a member of the Rental Rewards Program?
Check boxes
You've been asked to design an application that will process the transactions for Jack of All Trades, which rents small power equipment to commercial and residential customers. The strCustomer variable will be used to determine whether a customer is commercial (C) or residential (R). Commercial customers receive a 10% discount if they are members of the Rental Rewards Program. Residential customers receive a 5% discount if they are members. The strMember variable will be used to determine whether the customer is (Y) or is not (N) a member of the Rental Rewards Program. You meet with the manager of Jack of All Trades and she tells you that she would like the clerks to ask customers whether they want their receipt printed, emailed, texted, or any combination of these choices. Based on this feedback, you decide to use ____________ for the receipt choices in the interface.
For intCounter = 0 To 3
Your supervisor wants you to change the Do...Loop in the previous problem to a For...Next loop. He would like the message to appear only three times. Which For clause should you use?