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
Const dblRATE ...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q50: What is a static variable? How is
Q51: Explain the scope and lifetime of variables.How
Q52: Case 1 - PetPals
You have been hired
Q53: A procedure in an application needs to
Q54: What is a TextChanged event? How can
Q55: An application allows a user to enter
Q56: The Decimal,Double,and Single variable data types can
Q57: The decRate variable contains the number .03.Write
Q58: The following sample of code contains errors.
Q60: An application translates English words into French
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents