Results 1 to 15 of 15

Thread: Algebra program

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    107

    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?

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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.


  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Re: Algebra program

    You can also use matrices to solve simultaneous equations quite easily... When you get up to that stage

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    107

    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

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    107

    Re: Algebra program

    I tried all day, and still havent figured it out. Please help.

  7. #7
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    269

    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)

  8. #8
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    269

    Re: Algebra program

    HERE
    http://www.vbforums.com/showthread.p...ighlight=equal

    though not the same... you amy find some usefull info

  9. #9
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Algebra program

    Quote 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:
    1. 2x = y + 1  '--> then 2x - y = 1
    2. 2x - y = 5
    1<>5 so both equations are not related, so you CAN'T get X and Y values from there.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    107

    Re: Algebra program

    Jcis... thats the EXACT question in the book... so I know there is an answer, just dont know what it is.

  11. #11
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Algebra program

    Quote 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
    Show Appreciation. Rate Posts.

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    107

    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.

  13. #13
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Algebra program

    Quote 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:
    VB Code:
    1. 2x = y + 1
    2. 2x - y = 1
    Having that now the program should be able to find out that X=2 and Y=3
    Is that what you want?

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    107

    Re: Algebra program

    Yes, thats the answer, but how would i make a program to find the answers? And thanks for being so patient.

  15. #15
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Algebra program

    Moved to Math Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width