Essay
Problems - Correcting Logic and Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
An application allows the user to enter a salary amount. The application should then calculate and display the possible bonuses based on that salary, using bonus rates of 3-6% in increments of .5%.
' displays bonus amounts using rates
' of 3% - 6% in increments of .5%
Dim dblSalary As Decimal
Dim decBonus As Decimal
TryParse(txtSalary.Text, decSalary)
lblBonus.Text = String.Empty
For decRate As Decimal = 0.03 To 0.06 Step 0.5
decBonus = decSalary + decRate
lblBonus.Text = lblBonus.Text & decRate.ToString("P1") & " " & decBonus.ToString("C2") & ControlChars.NewLine
Next decRate
Correct Answer:

Verified
Dim decSalary As Decimal
Deci...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
Deci...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q7: The following sample of code contains errors.
Q9: Explain the difference between using the keywords
Q18: The symbol used to represent a loop
Q20: What is a counter-controlled loop and when
Q23: A counter is always incremented by a
Q28: Case-Based Critical Thinking Questions Case 1 -
Q28: If the stepValue is omitted when coding
Q29: A(n)_ read is used to prepare or
Q36: Programmers use a(n)_ when they need the
Q56: The startValue in a For...Next loop structure