Hi, I'm somehow new to Java so my question can seem trivial, however i cannot find an answer to it anywhere in my books.
I want to initiatie a dialog with a user in which he would enter an arithmetic expression (ex. (2*x+y)) And then print out the result for such expression (for given values of x and y)
String EXPRESION = null;
EXPRESION = JOptionPane.showInputDialog("Please enter expresion for dy/dx");
double x = 1.4;
double y = 5;
double output = HERE IS THE PROBLEM
JOptionPane.showMessageDialog("The value is" +output);
I fail to convert the string inserted by the user so it would serve as an arithmetic expression for x and y and hence define the value for output
TIA JMT