Question:
Visual Basic Question. Need Help!?
anonymous
2010-01-11 13:34:47 UTC
I have an assignment due for my computers class tommorow and I really need help. My teacher is terrible and I really have not grasped on to Visual Basic. Now we need to write a program for the area of 4 different shapes. Could you please help write a code for the following problem?


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
Five answers:
bridendolph
2016-12-17 22:51:45 UTC
in case you're using vista and that's in a compressed folder all you ought to do it double click it and it will open, if it replaced into zipped with winRAR then you definitely ought to apply winRAR to open it. attempt double clicking the folder, if its winrar then winrar will open if its something else then which will open. you ought to extract the information onto computing gadget or information or whereever you prefer o placed the information.
ussery
2016-12-09 00:17:10 UTC
in case you're utilising vista and that's in a compressed folder all you are able to desire to do it double click it and it will open, if it replaced into zipped with winRAR then you definately could use winRAR to open it. attempt double clicking the folder, if its winrar then winrar will open if its some thing else then which will open. you are able to desire to extract the data onto laptop or documents or whereever you elect o placed the data.
Phoenix @ the gates
2010-01-11 13:42:36 UTC
that's an awful lot of code, IM me if you want, and we'll work on it together online, what version of VB do you use?
jambul
2010-01-11 16:37:23 UTC
try read this free ebook:



http://hugebook.info/computer-programming-concepts-and-visual-basic-beginner-how-to
john doe
2010-01-11 13:38:08 UTC
{

cin>>x,

loop "i dont know"

cout>>x,

}


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...