Problems: Correcting Logic and Code ErrorsThe 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
What will be an ideal response?
Dim decSalary As DecimalDecimal.TryParse(txtSalary.Text, decSalary)For decRate As Decimal = 0.03 To 0.06 Step 0.005decBonus = decSalary * decRate
Computer Science & Information Technology
You might also like to view...
Which one of the following is the default operational setting for Windows Media Player?
A) expanded mode B) full mode C) skin mode D) compact mode
Computer Science & Information Technology
The ________ Wizard compares the common fields from two related tables and displays each record that does not have a corresponding value in the other table
A) Simple Query B) Locate Query C) Find Unmatched Query D) Crosstab Query
Computer Science & Information Technology