Prompt for mathematical expression of two variables, followed by evaluation

13 views Asked by At

I would like the user to be prompted to input an expression "E" like 2X or Y+3X^2 or √(X+Y). Then I would like to evaluate "E" with specific values for X and Y and store the output.

Here's a high-level idea of what I want to achieve:

Prompt X, Y
Prompt E # expression in terms of X, Y
eval(E,X,Y)→O # evaluation of expression E given values of X, Y
0

There are 0 answers