I've been working on doing some practice challenges, and I came across one that wanted me to print the variables associated with specified equations, like a = 5 + 3 / 2. When printing a it would solve the equation for a. I was curious if it was possible to set a equal to a custom equation input by the user with a method like the scanner method, so I'd want the program to do something like this: variable a = "user typed equation", then solve "user typed equation", and then print the variable a.
I tried setting up a scanner equal to a double equaling the next double then typed my equation in runtime, but it only printed the first double in my equation and failed to solve.