Write a java program to parse and evaluate programs consisting of assignment and
ID: 3548088 • Letter: W
Question
Write a java program to parse and evaluate programs consisting of assignment and print statements with fully parenthesized arithmetic expressions (see Program 4.3.5). For example, given the input
A = 5
B = 10
C = A + B
D = C * C
print(D)
your program should print the value 225. Assume that all variables and values are of type double. Use a symbol table to keep track of variable names.
Experiments
Write test programs to demonstrate that your Interpreter works correctly.
In particular, write a program to evaluate polynomials of the form:
ax^5 + bx^4 + cx^3 + dx^2 + ex + f
Discuss the limitations of this language. What kinds of programs can you write in Java that you cannot write here?