Question: Problems: Correcting Code Errors The following samples of code contain errors. Rewrite the incorrect statements to correct all errors. Private Sub btnCalc _ Click (
Problems: Correcting Code Errors
The following samples of code contain errors. Rewrite the incorrect statements to correct all errors.
Private Sub btnCalcClickByVal 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 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 txtNumHatsText, intNumHats
Decimal. TryParsetxtHatPrice decHatPrice
calculate and display the total amount owed
decDiscount decHatPrice dblRATE
decTotal intNumHats decHatPrice decDiscount
Total.Text decTotal.ToString C
End Sub
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
