Visual Basic Final

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

____ styles of combo boxes are available in Visual Basic.

Three

The method that removes characters from only the right end of a string is the ____ method.

TrimEnd

To remove characters from only the beginning of a string, use the ____ method.

TrimStart

A literal type character forces a literal constant to assume a data type other than the one its form indicates.

True

An independent Sub procedure is a procedure that is independent of any object and event.

True

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.

True

Menu title captions should be one word only and entered using uppercase letters.

True

Neither the Trim method nor the Remove method removes any characters from the original string.

True

The computer automatically processes an event procedure when the event occurs.

True

The most commonly used properties for a menu element are the Name and Text properties.

True

The number of arguments listed in the Call statement's argumentList should agree with the number of parameters listed in the parameterList in the procedure header.

True

Visual Basic allows you to specify that an argument in the Call statement is optional.

True

Which of the following shortcut keys should not be used in Windows applications that have an EDIT menu for menu items not on the EDIT menu?

both a and c

When you pass a variable ____, the computer passes only the contents of the variable to the receiving procedure.

by value

Which of the following statements will determine the number of items in the list portion of the Department combo box?

cboDepartment.Items.Count

You can use the ____ method to search a string to determine whether it contains a specific sequence of characters.

contains

The syntax ____ assigns a return value to a variable.

dblNewPrice = GetNewPrice(dblCurrentPrice)

A(n) ____ is processed only when it is called (invoked) from code.

independent Sub procedure

A character's ____ is an integer that indicates the character's position in the string.

index

If the digits argument is omitted, the Math.Round function returns a(n) ____.

integer

For the access key to work correctly in a combo box, you must set the label's TabIndex property to a value that is ____ the combo box's TabIndex value.

one less than

Assume that the data for salary is entered with both a dollar symbol and a space. Which of the following instructions will remove the dollar symbol?

salary.TrimStart("$")

Like the first item in a list box, the first item in a combo box has an index of ____.

0

Assume that a text box named PhoneNumberTextBox appears on a form and contains the phone number 414-555-5555. What value will display for the length of the phone number text box?

12

The expression Math.Round(287.876, 2) yields a value of ____.

287.88

Assume that the value of the string message is "Happy New Year". What value would message.IndexOf("New") yield?

6

An application used by the Human Resources (HR) department needs to be improved. You need to use various string manipulation properties and methods to ensure all data entered by a user is accurate and stored correctly. Each employee is assigned an employee code, such as F01234, which is stored in the strEmpCode variable. The first character is a letter for employment status (F for Full-time, P for Part-time). The next two characters are numbers representing 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?

strDept = strEmpCode.Substring(0, 1)

It is a common practice to begin a procedure's name with a(n) ____.

verb

As you do with list boxes, you use the Items collection's ____ method to add an item to a combo box.

Add

The ____ keyword in a function header identifies the data type of the data being returned.

As

The ____ method performs a case-sensitive search that returns the Boolean value True when the subString is contained anywhere in the string.

Contains

The default combo box style in Visual Basic is ____.

Dropdown

An event procedure is a Function procedure that is associated with a specific object and event.

False

Each menu in an application does not have to contain a menu title.

False

Math.Round(3.234, 2) returns the number 3.24.

False

The names of the arguments in a Call statement need to be identical to the names of the corresponding parameters.

False

You can determine whether a variable is being passed by value or by reference by looking at the Call statement.

False

A form's ____ procedure is responsible for verifying that the user wants to close the application, and then taking the appropriate action based on the user's response.

FormClosing event

An application used by the Human Resources (HR) department needs to be improved. You need to use various string manipulation properties and methods to ensure all data entered by a user is accurate and stored correctly. The application needs to process benefits for full-time employees only. Which of the following statements determines whether the strEmpCode variable contains an employee code for a full-time employee?

If strEmpCode Like "F*"

The strState variable should contain two uppercase letters. Which of the following statements determines whether the variable contains a valid state?

If strState Like "[A-Z][A-Z]" Then

The ____ operator evaluates to True when the string matches the pattern; otherwise, it evaluates to False.

Like

The ____ allows you to use pattern-matching characters to determine whether one string is equal to another string.

Like operator

In Visual Basic 2015, you use a(n) ____ to include one or more menus in an application.

MenuStrip control

Programmers use the ____ property of the menu element to refer to the menu element in code.

Name

The ____ method inserts the padded characters at the beginning of a string, which right-aligns the characters within the string.

PadLeft

When using ____, you capitalize the first letter in the procedure name and the first letter of each subsequent word in the name.

Pascal case

Which of the following is a valid header for a procedure that receives the address of a string variable and the address of an integer?

Private Sub GetInfo(ByRef strName As String, ByRef intAge As Integer)

An application used by the Human Resources (HR) department needs to be improved. You need to use various string manipulation properties and methods to ensure all data entered by a user is accurate and stored correctly. 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 dashes from any SSN that contains dashes. You will use the ____ method to edit the code so that only numeric characters are stored.

Remove

In most cases, the last statement within a function is the ____ expression.

Return

Which of the following is a valid Return statement?

Return dblNumber

____ keys appear to the right of a menu item and allow you to select an item without opening the menu.

Shortcut

To sort the items in the list portion of a combo box, you use the combo box's ____ property.

Sorted

Visual Basic provides the ____ method for accessing any number of characters contained in a string.

Substring

A combo box's ____ property contains the value that appears in the text portion of the control.

Text


Set pelajaran terkait

1.06 Quiz: Power and Government Part 2

View Set

English in Mind 1, Unit 3: Who's your hero?, EIM 1 Unit 3

View Set

Digital Forensics Ch 4 Review Questions

View Set