Question: In this exercise, you create an application that can be used to estimate the cost of laying sod on a rectangular piece of property. Create

In this exercise, you create an application that can be used to estimate the cost of laying sod on a rectangular piece of property. Create a Windows Forms application. Use the following names for the project and solution, respectively: Sod Project and Sod Solution. Save the application in the VB2017\Chap10 folder. Use Windows to copy the Rectangle.vb file from the VB2017\Chap10 folder to the Sod Project folder. Then, use the Project menu to add the file to the project. Create the interface shown in Figure 10-40 and then code the application using the Integer data type for the length and width measurements. Display the total price with a dollar sign and two decimal places. Save the solution and then start and test the application.

In this exercise, you create an application that can be used to

Rectangle vb code.

estimate the cost of laying sod on a rectangular piece of property.

My code:

' Name: Rectangle.vb ' Programmer: Matthew Herrin 11/19/2018

Option Explicit On Option Strict On Option Infer Off

Public Class Rectangle Private intLength As Integer Private intWidth As Integer

Public Property Length As Integer Get Return intLength End Get Set(value As Integer) If value > 0 Then intLength = value Else intLength = 0 End If End Set End Property

Public Property Width As Integer Get Return intWidth End Get Set(value As Integer) If value > 0 Then intWidth = value Else intWidth = 0 End If End Set End Property

Public Sub New() intLength = 0 intWidth = 0 End Sub

Public Sub New(ByVal intL As Integer, ByVal intW As Integer) Length = intL Width = intW End Sub

Public Function GetArea() As Integer Return intLength * intWidth End Function Public Class Rectangle

Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click Dim area, total, lenght, width, price As Double lenght = Convert.ToDouble(txtLength.Text) width = Convert.ToDouble(txtWidth.Text) price = Convert.ToDouble(txtsodperyd.Text) area = lenght * width total = area * price txtTotal.Text = "$" & Convert.ToString(total) End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class

WHEN I GO TO DESIGN THE WINDOW CODE DOESN'T WANT TO WORK JUST NEED HELP FIXING GLOBAL DESIGN CODE

Sod Depot Length (feet): Width (feet): Sod price (per sq yd) Total prices Calculate Egit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!