Filters
Question type

Study Flashcards

The Trim method is used to remove characters only from the end of a string.

A) True
B) False

Correct Answer

verifed

verified

Describe four of the six menu standards that should be followed when including a menu in an application.

Correct Answer

verifed

verified

1.Menu title captions should be one word...

View Answer

The following sample of code contains errors. Rewrite the incorrect statements to correct all errors. -Private Sub btnDisplay_Click(ByVal sender As Object,ByVal e As System.EventArgs)Handles btnDisplay.Click ' displays type of vehicle for the code entered by user Const strLENGTH_MSG As String = "The code must contain four characters." Const strTYPE_MSG As String = "The last character in the code must be C,T,or V." Dim strCode As String Dim strLastChar As String strCode = txtCode.Text.ToLower ' determine whether code contains exactly 4 characters If strCode.Chars < 4 Then lblType.Text = String.Empty MessageBox.Show(strLENGTH_MSG,"Code", MessageBoxButtons.OK, MessageBoxIcon.Information) Else ' determine whether the last character is valid strLastChar = strCode.Substring(4) Select Case strCode Case "C" lblType.Text = "Car" Case "T" lblType.Text = "Truck" Case "V" lblType.Text = "Van" Case Else lblType.Text = String.Empty MessageBox.Show(strType_MSG,"Type", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End If End Sub

Correct Answer

verifed

verified

Private Sub btnDisplay_Click(ByVal sende...

View Answer

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

A) True
B) False

Correct Answer

verifed

verified

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


A) Insert method
B) Like operator
C) Contains method
D) MenuStrip control

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

Write the Visual Basic statement to assign the number of characters in the txtSSN control's Text property to the intSSNNumChar variable.

Correct Answer

verifed

verified

intSSNNumC...

View Answer

What is the difference between a menu item's access key and shortcut key?

Correct Answer

verifed

verified

The access key allows the user to select...

View Answer

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


A) -1
B) 2
C) 6
D) 7

E) All of the above
F) C) and D)

Correct Answer

verifed

verified

Write a Visual Basic statement that removes the last four digits of the credit card number and assigns it to the strCCLastFour variable. strCCNum = "4456778996352852"

Correct Answer

verifed

verified

strCCLastF...

View Answer

Case 1 - Human Resources Application 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?


A) If strEmpCode Like "[A-Z]#####"
B) If strEmpCode.ToUpper Like "F####"
C) If strEmpCode Like "F*"
D) If strEmpCode Like "!F*"

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

Each menu element is considered a(n) ____ and has a set of properties associated with it.


A) class
B) character
C) object
D) string

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

Write the Visual Basic statements needed to format decNetPay with two decimal places,pad the formatted variable with asterisks until its length is 12,and then insert a dollar sign ($)as the first character.The result is assigned to the strNetPayFormat variable.

Correct Answer

verifed

verified

strNetPayFormat = decNetPay.To...

View Answer

The strSerialNum variable contains the string "DRY259614".Write the Visual Basic statement that assigns the string "259614" from the strSerialNum variable to the strProductCode variable.

Correct Answer

verifed

verified

strProductCode = str...

View Answer

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


A) Like operator
B) Contains method
C) Insert operator
D) MenuStrip control

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

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.

A) True
B) False

Correct Answer

verifed

verified

The txtGrade control contains the string "95%".Write the Visual Basic statement to remove the percent sign from the txtGrade control as well as convert the contents of the control to a Decimal number.Assign the result to the decGrade variable.Use the TrimEnd method.

Correct Answer

verifed

verified

Decimal.TryParse(txt...

View Answer

The following sample of code contains errors. Rewrite the incorrect statements to correct all errors. -Private Sub btnDisplay_Click(ByVal sender As Object,ByVal e As System.EventArgs)Handles btnDisplay.Click ' displays a pay rate based on an employee's code ' Full Time employee pay rate is 11.50.Part Time ' employee pay rate for those working more than 30 hours ' is 10.50,otherwise it is 9.50 Dim strEmpCode As String Dim decPayRate As Integer strCode = txtEmpCode.Text.Snip ' validate the employee code If strEmpCode = "FT##" Then decPayRate = 11.50 ElseIf strEmpCode Like "PT30##" Then decPayRate = 9.50 Else decPayRate = 10.50 End If ' display pay rate lblPayRate.Text = decPayRate.ToString("N2") End Sub

Correct Answer

verifed

verified

Private Sub btnDisplay_Click(ByVal sende...

View Answer

How many characters will be removed from the string below? Dim myString as string = "ABCDEFGH" MyString = myString.Remove(2,3)


A) one
B) two
C) three
D) four

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

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?


A) Ctrl+X
B) Ctrl+Q
C) Ctrl+V
D) both a and c

E) C) and D)
F) A) and C)

Correct Answer

verifed

verified

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


A) Text
B) Name
C) Description
D) Title

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

Showing 21 - 40 of 60

Related Exams

Show Answer