Examlex

Solved

The Following Sample of Code Contains Errors

question 42

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


Definitions:

Jakobson's Semiotic

Roman Jakobson's theory related to the study of signs and symbols, focusing on their role in communication processes.

Conative Function

One of Jakobson’s semiotic functions. Establishes the sender’s expectations of the receiver or what the receiver is expected to do as a result of receiving the message.

Sender's Expectations

Sender's expectations refer to the anticipations or assumptions held by the initiator of a communication about how the message will be received and understood by others.

Qualitative Analyses

Non-numerical examination and interpretation of observations, for the purpose of discovering underlying meanings and patterns of relationships.

Related Questions