Essay
Problems - Correcting Logic and Code Errors
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:

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
Q1: _ keys appear to the right of
Q10: The _ method returns an integer that
Q12: Problems - Correcting Logic and Code Errors
Q14: Case-Based Critical Thinking Questions Case 1 -
Q29: If an application expects the user to
Q36: Programmers use the _ property of the
Q40: The txtGrade control contains the string "95%".Write
Q49: To remove characters from only the beginning
Q50: Assume that a text box named PhoneNumberTextBox
Q54: The strPhone variable contains a 10-digit phone