|
-
Mar 10th, 2010, 04:44 PM
#1
Thread Starter
Member
Need with a math application
I need to create an application which allows the user to figure out the area and perimeter by entering length and width of a rectangle. How would I start this.
Thanks in advance.
-
Mar 10th, 2010, 04:49 PM
#2
Thread Starter
Member
Re: Need with a math application
Dim int1 As Integer
Dim int2 As Integer
Dim intAnswer As Integer
lblarea.Caption = "Area"
lblper.Caption = "Perimetre"
int1 = txt1.Text
int2 = txt2.Text
this is what i have write down so far. txt1 and txt2 are the names of my two text boxes. What would the equation be.
-
Mar 10th, 2010, 04:53 PM
#3
Re: Need with a math application
Thread moved from the 'CodeBank VB6' forum (which is for you to post your code examples, not questions) to the 'VB6' forum
-
Mar 10th, 2010, 04:58 PM
#4
Re: Need with a math application
Chris
Start with doing it in "english"
If the 4 sides are (going clockwise) 4, 1, 4, 1, then..
what is the perimeter?
what is the area?
Then try to write that in code.
Does that help?
Spoo
-
Mar 10th, 2010, 05:09 PM
#5
-
Mar 10th, 2010, 07:33 PM
#6
Re: Need with a math application
Sounds like the biggest problem here is that numbers and only numbers exist in the text boxes before you calculate the area and the perimeter of the rectangle.
Is that right? If not, then our nation's junior high schools and high schools are migrating back to the stone age.
http://en.wikipedia.org/wiki/Rectangle
Last edited by Code Doc; Mar 10th, 2010 at 07:56 PM.
Doctor Ed
-
Mar 10th, 2010, 07:40 PM
#7
Re: Need with a math application
 Originally Posted by chrisman10
...this is what i have write down so far... What would the equation be.
A simple google for perimeter area rectangle will define the formulas you want and give plenty of examples. Gotta be only 2 minutes effort at most.
-
Mar 13th, 2010, 07:52 PM
#8
Thread Starter
Member
Re: Need with a math application
Guys you are making it sounds so complicated i learned it at school. It only took me 2 mins to do it.
-
Mar 13th, 2010, 07:54 PM
#9
Thread Starter
Member
Re: Need with a math application
This is what it looked liked
Dim int1 As Integer
Dim int2 As Integer
Dim intAnswer As Integer
int1 = txt1.Text
int2 = txt2.Text
intAnswer = int1 * 2 + int2 * 2
lblanswer.Caption = intAnswer
intAnswer2 = int1 * int2
lblanswer2.Caption = intAnswer2
-
Mar 13th, 2010, 08:55 PM
#10
Re: Need with a math application
 Originally Posted by chrisman10
This is what it looked liked
Dim int1 As Integer
Dim int2 As Integer
Dim intAnswer As Integer
int1 = txt1.Text
int2 = txt2.Text
intAnswer = int1 * 2 + int2 * 2
lblanswer.Caption = intAnswer
intAnswer2 = int1 * int2
lblanswer2.Caption = intAnswer2
So that your code is easier for others to read wrap [highlight="vb"][/highlight] tags around it.
Last edited by Nightwalker83; Mar 13th, 2010 at 10:09 PM.
Reason: Fixed spelling!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Mar 13th, 2010, 09:40 PM
#11
Re: Need with a math application
 Originally Posted by chrisman10
Guys you are making it sounds so complicated i learned it at school. It only took me 2 mins to do it.
Trust me, we knew how to do it too. It sounds like homework and we were not going to do it for you. You were asking for something that we all learned in grade school; and that can be interpretted 2 ways: 1) you were too lazy to write the code yourself, or 2) you honestly didn't know the equation which is why we suggested where you could find them.
Obviously you were able to write the code yourself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|