Examlex
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 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
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
Nucleus Accumbens
A region of the brain known for its critical role in the reward circuit, associated with pleasure, reward, and reinforcement learning.
Technique
A method or way of doing something, especially one that is skilled or specialized.
Larger Request
In the context of persuasion, starting with a high-demand request that is likely to be rejected, followed by a smaller request.
Real Request
A genuine or sincere appeal or demand made by one party to another.
Q15: To remove characters from only the beginning
Q25: Explain the difference between using the keywords
Q29: The _ method pads the string on
Q36: _ means assigning a beginning value to
Q38: Write the If statement that determines whether
Q41: An access key allows the user to
Q43: The following instruction will remove which character
Q51: What is the value returned from the
Q51: Which of the following instantiates a Product
Q60: _ is a set of statements that