Question: Basic Part ( 1 0 0 points ) Problem Description This project is about design and implement expression trees, which are special cases of parse
Basic Part points
Problem Description
This project is about design and implement expression trees, which are special cases of parse
trees or grammar trees. you need to implement a program to do the following:
a Takes a binary arithmetic expression as input, builds a binary expression tree for the
input expression
b Check whether there are any syntactic or semantic errors in the expression. If yes, then
report the errors.
c If there are no errors in the input expression, then
Calculate and display the value of the input expression.
Print the infix inorder traversal prefix preorder traversal and postfix post
order traversal expressions of the input expression.
For ease of your implementation and testing, your program shall input arithmetic expressions
from a text file. To help build the binary expression tree, you shall use two stack type data
structures, one helps manage operators from the arithmetic expression, and the other help
manage the tree nodes for building the trees.
The table below lists operation precedence and association orders.
Use the following input arithmetic expressions to test your program:
:
Note:
Expression has no syntactic errors.
Expressions and have one error each.Optional Part for possible extra credits
In addition to binary arithmetic expressions, I would like you to consider binary relation operators of and logical operators of && and I ask you to expand the functionality of your program for binary arithmetic expressions to deal with expressions that is composed of parentheses, binary arithmetic operator, binary relational operators, and logical operators.
This optional part is not required. If you can finish it Ill give to extra points for you.
Use the following input arithmetic expressions to test your program:
&&
&&
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
