|
-
Mar 30th, 2006, 11:02 PM
#1
Thread Starter
Lively Member
Algebra program
Ok, what I want to do is create a program that will solve my equations for me. I have looked on some information, but nothing was helping me. I made one that will let me input my own 'x' and 'y' s and it tells me if its right or not.. but I want it to solve it on its own like for example ...
2x = y + 1
2x - y = 5
Could someone please help me?
-
Mar 30th, 2006, 11:10 PM
#2
Re: Algebra program
i dont know algebra...if you solve it here in your steps then we can convert that into vb codes
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Mar 30th, 2006, 11:16 PM
#3
Re: Algebra program
An algebra parser would be quite entertaining.
I suggest you start with single equations (simultaneous equations can come later). First try splitting the equation into the left hand and right hand side expressions.
User input: 2x = 5
LHS: 2x
RHS: 5
You already have x on one side so what you need to do is get it down to 1x:
LHS = x
RHS = 5/2 = 2.5
Result: x = 2.5
The tricky part is the string manipulation you need to do to get there. But if you start with some simple equations and work through the mental process you would take to get the result, see if you can apply that in code.
-
Mar 31st, 2006, 04:03 AM
#4
Conquistador
Re: Algebra program
You can also use matrices to solve simultaneous equations quite easily... When you get up to that stage
-
Mar 31st, 2006, 08:07 AM
#5
Thread Starter
Lively Member
Re: Algebra program
I thank you guys for the help, but its not helping me too much. :-/ I dunno how to insert that into code. I know some vb, not enough to do this on my own though. Anyone mind helping? And Penagate you forgot the 'y' :P
-
Mar 31st, 2006, 09:05 PM
#6
Thread Starter
Lively Member
Re: Algebra program
I tried all day, and still havent figured it out. Please help.
-
Mar 31st, 2006, 09:41 PM
#7
Hyperactive Member
Re: Algebra program
1st: its possible to do what you want from the beggining. but maybe its easier if you have 2 textboxes and in the middle like a combobox from which the user can choose =, >, <, >= or <= ......
anyways: post EXACTLY the way you would like the user to input information and EXACTLY the kind and complex level of equations you want this prog to handle... at least in its 1st stage 
cause its a long code to write for the realizing you want something else 
also there was another topic similar to this... ill make a search and post the link (it wasnt exactly the same though)
-
Mar 31st, 2006, 09:44 PM
#8
Hyperactive Member
Re: Algebra program
HERE
http://www.vbforums.com/showthread.p...ighlight=equal
though not the same... you amy find some usefull info
-
Mar 31st, 2006, 09:59 PM
#9
Re: Algebra program
 Originally Posted by Columbine
I tried all day, and still havent figured it out.  Please help.
If you want to get the value of X, then 1 equation is enough (without Y), but if you want to get X and Y you need to supply 2 equations, but these from your first post look impossible to be True..
VB Code:
2x = y + 1 '--> then 2x - y = 1
2x - y = 5
1<>5 so both equations are not related, so you CAN'T get X and Y values from there.
-
Apr 1st, 2006, 12:47 PM
#10
Thread Starter
Lively Member
Re: Algebra program
Jcis... thats the EXACT question in the book... so I know there is an answer, just dont know what it is.
-
Apr 1st, 2006, 03:23 PM
#11
Re: Algebra program
 Originally Posted by Columbine
Jcis... thats the EXACT question in the book... so I know there is an answer, just dont know what it is.
jcis is right, but if you think the equations are right, then please post the whole question from the book as it is. probably then we may help you.
Harsh
-
Apr 1st, 2006, 07:12 PM
#12
Thread Starter
Lively Member
Re: Algebra program
That is the WHOLE question, you have to find out what x and y is.. but they have to be the same in both equations.
-
Apr 1st, 2006, 07:20 PM
#13
Re: Algebra program
 Originally Posted by Columbine
That is the WHOLE question, you have to find out what x and y is.. but they have to be the same in both equations.
Ok, but both equations must be related each other, not like the example in your first post, example:
Having that now the program should be able to find out that X=2 and Y=3
Is that what you want?
-
Apr 2nd, 2006, 12:13 PM
#14
Thread Starter
Lively Member
Re: Algebra program
Yes, thats the answer, but how would i make a program to find the answers? And thanks for being so patient.
-
Apr 3rd, 2006, 06:18 AM
#15
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
|