Question: What about BEDMAS?
In one of the replies, I note that no account is made for order of operation. Is this a requirement of your final solution?
Regards
Err, HarryW, don't you mean...
Quote:
When you have the subterms you apply the + and - operators to them with an add/subtract function, and when values for those functions are returned you apply the * and / operators to them with a multiply/divide function.
I think you mean that you would do the / and * first, then once those have returned, do the + and -? The way you wrote it, it seems like you'd propose doing it backwards :)
But in case I read your suggestion backwards, I can tell you now that I agree with your general approach. I made the same sort of thing into a set of Java Classes for a project I worked on. When you start allowing user defined functions and brackets (not to mention exponents), life gets interesting :)
Cheers