How would someone implement mathematical formulae in Java?
What I mean, the user inputs a string with multiple variables. Like a simple quadratic formula: x^2 + 5x + 10. Or in Java: (Math.pow(x,2)) + (x * 5) + 10
. The user would then enter that and then the program would solve for x. I will be using the BeanShell Interpreter class to interpret the string as an equation. But how would I solve for x?