



Basically The problem is that the answer I'm getting is not the same as the example of the answer I provided or similar. I just need the code so that when I enter any length, any width, any price of sod I should be getting a total price not a blank in the total price and $0.00 in the sod price text box? I just need the correct code to be able to run this application the way it wants me to. specifically for the part in question 4 that says A Calculate button that when clicked determines the total cost of laying sod based upon the three values entered by the user. The three values are Length, Width, Sod Price
This is the code I have at the moment.
Public Class frmMain
'creating object of rectangle
Dim rectangle As New Rectangle()
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
Dim Length As Integer
Dim Width As Integer
Dim rect As New Rectangle(Length, Width)
Dim area As Integer = rect.GetArea()
Dim Price As Double
'Since the area is in sq feet and price is given per sq yards
'We'll convert sq feet to sq yard, by dividing by 9
Dim areaInSqYd As Double = area / 9
Dim totalPrice As Double = areaInSqYd * Price
'Call the sub routine updatedisplayTotalPrice to update the text.
updatedisplayTotalPrice(totalPrice)
'Displays the total price in proper currency format
txtPrice.Text = String.Format("{0:C2}", totalPrice)
End Sub
Private Sub updatedisplayTotalPrice(ByVal totalPrice As Double)
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class
Thanks