Essay
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
-Private Sub btnCalc_Click(ByVal sender As Object,ByVal e As System.EventArgs)Handles btnCalc.Click
' calculates and displays the total amount owed for purchasing hats
' user enters number of hats and price per hat
' all hats are on sale for 25% off the price
Dim dblNumHats As Integer
Dim decHatPrice As Decimal
Dim decDiscount As Double
Dim decTotal As Decimal
' assign number of hats and price to variables
Integer.TryPurse(txtNumHats.Text,intNumHats)
Decimal.TryParse(txtHatPrice,decHatPrice)
' calculate and display the total amount owed
decDiscount = decHatPrice * dblRATE
decTotal = (intNumHats + decHatPrice)- decDiscount
Total.Text = decTotal.ToString(C2)
End Sub
Correct Answer:

Verified
Dim intNumHats As Integer
Const dblRATE ...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
Const dblRATE ...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q35: The following sample of code contains errors.
Q36: You cannot associate a procedure with more
Q37: An application allows a user to enter
Q38: A named constant's value cannot be changed
Q39: A Boolean variable is initialized to the
Q41: The ControlChars.NewLine constant instructs the computer to
Q42: Which of the following statements formats the
Q43: Case 1 - PetPals<br>You have been hired
Q44: A variable that was not assigned a
Q45: Which of the following statements declares a