subject
Engineering, 16.04.2020 04:43 windmadness5331

A menu driven program:1- ask to enter an inorder arithmetic expression, the input should be fully parenthesized2- display the infix order of the expression3- display the prefix order of the expression4- evaluate the expression and display the answer (could be done by converting the infix expression into a postfix expression by using a stack)details are shown in the picture below :

Project Description: An Expression Tree Builder/Evaluator An arithmetic expression can be represented using a binary tree whose leaves are associated with variables or constants, and whose internal nodes are associated with one of the operators +, -, *, and . Each node has a value associated with it. write an implementation of the BǐExpTree class. You can use either array-based or linked-based implementation. The BiExpTree class has the following methods 1.BİExpTree0: to construct an empty binary expression tree 2. CreateExp (exp) takes a fully parenthesized expression and builds a binary expression tree representation fort. You may assume that all operators are values (variables are not required). 3. prefix) displays the prefix form of the expression 4. infix0: displays the infix form of the expression stored in the 5. evalExp0: evaluates the arithmetic expression stored in the stored in the calling BiExpTree object calling BiExpTree object calling BiExpTree object and returns its value. gram: Write a menu-driven program to implement an expression tree builder and evaluator. The menu includes the following options 1. Input new arithmetic expression. The program w prompt the user to enter a fully parenthesized arithmetic expression. A binary expression tree corresponding to that expression is created. You may assume that only valid input is expected 2. Display prefix form of expression The programw invoke the prefix) method from the BİExpTree class to display a prefix form of the expression. 3. Display infix form of expression. The program invoke the infix method from the BİExpTree class to display an infix form of the expression. 4. Evaluate expression. The program wl call the EvalExprO method from the BİExpTree class. 5. Exit.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Acompressor receives the shaft work to decrease the pressure of the fluid. a)- true b)- false
Answers: 3
question
Engineering, 04.07.2019 18:10
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
Slip occurs via two partial dislocations because of (a) the shorter path of the partial dislocation lines; (b) the lower energy state through partial dislocations; (c) the charge balance.
Answers: 1
You know the right answer?
A menu driven program:1- ask to enter an inorder arithmetic expression, the input should be fully pa...
Questions
question
Mathematics, 25.09.2020 23:01
question
Mathematics, 25.09.2020 23:01
Questions on the website: 13722360