Essay
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 the pay rate associated with a pay code
Dim strCodes()As String = {PT1,PT2,FT1,FT2,FT3}
Dim dblRates()As Integer = {10.5,12,13.5,14}
Dim strSearchForCode As String
Dim intSub As Integer
' assign the code to a variable
txtCode.Text = strSearchForCode
' search the strCodes array for the pay code
' continue searching until the end of the array
' or the pay code is found
Do Until intSub > strCodes.Length OrElse
strSearchForCode = strCodes(intSub)
intSub = intSub + 1
Loop
' determine whether the pay code was found
If intSub < strCodes.Length Then
lblRate.Text = dblRates(1).ToString("C0")
Else
MessageBox.Show("Invalid Pay Code",
"Employee Pay Application",
MessageBoxButtons.OK,
MessageBoxIcon.Information)
End If
txtCode.Focus()
End Sub
Correct Answer:

Verified
Private Sub btnDisplay_Click(ByVal sende...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q37: Based on the code below,intScores(2,1)is initialized to
Q38: An advantage of using the For Each…Next
Q39: A two-dimensional array resembles a table in
Q40: Case 1 - Tony’s Pizza & Pasta<br>The
Q41: Which of the following correctly shows the
Q43: Write the statement to declare a five-element
Q44: Two or more arrays whose elements are
Q45: If a one-dimensional array contains five elements,its
Q46: The data in a two-dimensional array are
Q47: Consider the following array: <br>Dim numbers(,) As