anonymous
2010-01-11 13:34:47 UTC
Create a form that calculates the area of a square, rectangle, triangle or circle. After selecting the shape from a list box, the user will then be prompted to enter the appropriate dimensions into one or more textboxes. Pressing the Calculate button will output the area to a label.
Do not allow the user to Calculate without selecting a shape. An error message will suffice.
The function lstListBox.SelectedIndex() will return a -1 if nothing is selected. Otherwise, the function will return the item number of the selection, starting at 0.
The user must enter numbers for the dimensions. Note: The IsNumeric(txtTextBox.Text) function will return true if the text property is a number. Otherwise it will return false. If numbers are not present, return an error message.
Use the following formulas to calculate the areas:
Square = side^2
Rectangle = width x height
Triangle = (base x height) / 2
Circle = 3.1417 * (radius^2)
It's supposed to have a ListBox with the four shapes, and a "Calculate" button that when pressed will show the answer. I have very little clue on how to do this, and any help would be greatly appreciated. Thank you in advance