I am new to VB and usually work in C but was wanting to see if someone can take a look at this program and give me any advice I would really appreciate it and also let me know if I am close...
I am going to first give instructions and then the code and please let me know if you can see what im doing wrong and if you need the actual form and what it looks like please email me your address...
Programming Assignment One
Bearcat Green, a local lawn and garden enterprise, has asked you to create a program to assist their sales staff with correctly computing the amount of seed, fertilizer, or other product to sell a client for a given coverage area.
Normally, a coverage area is expressed in some rectangular area with a product amount associated with that coverage area. For example, a fertilizer product may recommend using 1 pound per 5000 square feet.
Clients bring in the dimensions of the area that they wish to seed or feed. The dimensions may be expressed in inches, feet, or yards. The program you develop should take a decimal number value for the length and width of the area to be treated.. The program user will define the units – inches, feet, or yards – at runtime.
Each product sold comes with a recommended coverage value. This coverage value normally indicates a value in pounds and the square feet or square yards that are covered. See the example above.
The programs output should indicate how many pounds of product the client should purchase
HERE IS MY CODE...
Public Class bearcatGreenProductCalculator 'DECLARE VARIABLES Dim inchesLength As Double Dim inchesWidth As Double Dim inchesSquareFeet As Double Dim inchesSquareYards As Double Dim feetLength As Double Dim feetWidth As Double Dim feetSquareFeet As Double Dim feetSquareYards As Double Dim yardsLength As Double Dim yardsWidth As Double Dim yardsSquareFeet As Double Dim yardsSquareYards As Double Private Sub inchesRadioButton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) 'IF STATEMENT FOR INCHES RADIO BUTTON IS CHECKED If inchesRadioButton.Checked = True Then lengthTextBox = inchesLength widthTextBox = inchesWidth inchesSquareFeet = (inchesLength / 12) * (inchesWidth / 12) inchesSquareYards = ((inchesLength / 12) / 3) * ((inchesWidth / 12) / 3) End If End Sub Private Sub feetRadioButton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles feetRadioButton.CheckedChanged 'IF STATEMENT FOR FEET RADIO BUTTON IS CHECKED If feetRadioButton.Checked = True Then lengthTextBox = feetLength widthTextBox = feetWidth feetSquareFeet = feetLength * feetWidth feetSquareYards = (feetLength \ 3) * (feetWidth \ 3) End If End Sub Private Sub yardsRadioButton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles yardsRadioButton.CheckedChanged 'IF STATEMENT FOR YARDS RADIO BUTTON IS CHECKED 'If yardsRadioButton.Checked = True Then lengthTextBox = yardsLength widthTextBox = yardsWidth yardsSquareFeet = (yardsLength * 3) * (yardsWidth * 3) yardsSquareYards = yardsLength * yardsWidth End Sub
Edited 6 Years Ago by __avd: Fixed [code] tags.