Read up on the StringTokenizer class (java.util.StringTokenizer

Once you have the individual tokens, you need to have some "ground rules" built in. For example:

- since your problem domain is restricted to single-variable polynomials, you need the applet to recognize the operator signs +, -, *, /. And perhaps ^ (exponentiation), or do you want to expand all exponentiation using * (multiplication) as your example equation does?

- for completeness, you should also be able to understand parentheses () to group the operations together.

- do you want to recognize only 'x' as a valid variable symbol, or any letter of the alphabet?

- finally, your code should know the default operator precedence rules where there are no parentheses - i.e. exponentiation takes precedence over everything else, followed by division, multiplication, subtraction, and addition in that order (I think this is the right order...)

HTH

- Ravs

Do you want to assume