(JAVA)
Hello so I want to write a program where the input is (2+3)*(2+1) for example I want my program to return 15.
Is there a way of making the input (2+3)*(2+1) into a integer?
I know that you can write
int product = (2+3)*(2+1);
however, can I write this something like:
String input = (2+3)*(2+1);
int product = input;
Obviously this does not work. But can it be done in a beautiful way without using recursive functions that call eachother?