Consider arithmetic expressions like the ones described in the previous project. Allow operands to be either integer values or variable names that are strings of letters. Design and implement an...


Consider arithmetic expressions like the ones described in the previous project. Allow operands to be either integer values or variable names that are strings of letters. Design and implement an iterative algorithm that uses a stack to test whether an expression is legal in Lisp. Write a program that reads potential expressions and demonstrates your algorithm. Each expression that your program reads can be split across several lines, which is the style used by typical Lisp programmers. For example, the following expression is legal in Lisp:


Write a program that graphically displays a working calculator for simple infix expressions that consist of single-digit operands; the operators +, -, *, and /; and parentheses. Make the following assumptions:


As the user presses keys to enter an infix expression, the corresponding characters appear in the display. The C (Clear) key erases all input entered so far; the 6 (Backspace) key erases the last character entered. When the user presses the = key, the expression is evaluated and the result replaces the expression in the display window. The user can then press C and enter another expression. If the user presses the Q (Quit) key, the calculator ceases operation and is erased from the screen.

Nov 15, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here