
-----------------------------------
Homer_simpson
Sat May 10, 2003 11:59 pm

Math formula solver...
-----------------------------------
the point of this program is to input a math formula and get the answer...
it only works with  */+-  at the time but i'm working on brackets.

-----------------------------------
Catalyst
Sun May 11, 2003 12:05 am


-----------------------------------
it doesnt work :( 
the order of operations isnt there it just reads left to right

-----------------------------------
Tony
Sun May 11, 2003 12:14 am


-----------------------------------
ya, thats what I said earlier in my post...

first you have to search your operations for any *s and /s... And do them first. Then resort your array and do left to right the way you have it now once only +- are left.

let me give you an example

1 + 2 * 3 - 1

the result should be 6, though your program will output 8

now if you search for *s first...

1 + (6) - 1

after calculating 2*3 you store its value in the place of 2. Then you move the rest of your array down one spot to get rid of non existing *3 (since its already calculated).

-----------------------------------
Catalyst
Sun May 11, 2003 12:14 am


-----------------------------------
im gonna try to make something like this

-----------------------------------
Homer_simpson
Sun May 11, 2003 10:37 am


-----------------------------------
well i'm not done
but i'll look forward to fixing the operation order...

-----------------------------------
Martin
Sun May 11, 2003 8:23 pm


-----------------------------------
Check out Bugz' sybolic calculator

-----------------------------------
Martin
Sun May 11, 2003 8:25 pm


-----------------------------------
http://www.compsci.ca/bbs/viewtopic.php?t=568


Bugz's probably the smartest person that I know

-----------------------------------
Asok
Sun May 11, 2003 9:07 pm


-----------------------------------
that one doesn't filter the bedmas though ie.

1+2*3 = 7

the program will say 9

-----------------------------------
Homer_simpson
Sun May 11, 2003 9:58 pm


-----------------------------------
that is a good caclulater but my projects is a totally different thing
when i finish it will be able to give you the answer
to 
x = 2x + 3 
I dont think that calc can do that....

-----------------------------------
Asok
Sun May 11, 2003 10:14 pm


-----------------------------------
x = -3

-----------------------------------
Homer_simpson
Sun May 11, 2003 10:41 pm


-----------------------------------
grrrrr... the calc doesn't give u that.....

-----------------------------------
Asok
Sun May 11, 2003 10:53 pm


-----------------------------------
well for your program you could have a for loop running all possibilities from -1000 to 1000 and an if statement checking to see if it's correct. eventually you'll find the answer.

-----------------------------------
Homer_simpson
Mon May 12, 2003 12:35 am


-----------------------------------
bwahahahaaaaaa...... 
that's just dumb!!!! what if some1 enters the equation 3x=x-1000000000

-----------------------------------
Asok
Mon May 12, 2003 6:42 am


-----------------------------------
well like real-life calculators there can be a character limit.

-----------------------------------
Homer_simpson
Mon May 12, 2003 12:18 pm


-----------------------------------
that's true but first of all not all caclulators solve equations and the ones that do dont do it by guessing numbers...
