Examlex

Solved

The Following Sample of Code Contains Errors

question 40

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


Definitions:

DNA Samples

Biological material collected for the purpose of genetic testing, analysis, or identification.

Transitional Expression

Words or phrases that provide a connection between ideas, sentences, and paragraphs, making text easier to read and understand.

Blood Vessels

Tubular structures carrying blood through the tissues and organs; a vital part of the circulatory system.

Alcoholics Anonymous

A fellowship of people who share their experience, strength, and hope with each other to solve their common problem and help others recover from alcoholism.

Related Questions