How do I solve a math problem that is in a string? The user will enter a math problem that starts with the word calculate. like "calculate 5 + 2" or "calculate 10 - 3" and the program needs to solve it.
So far I have the user ask a question and then if (question.toLowerCase().contains("calculate")). Now I need it to solve but idk what to do.