Solved-HW4: Expression Trees -Solution

$35.00 $24.00

For this assignment you will write a program that reads postfix expression from the user, one per line, terminating when the user enters a blank line. (Follow the same input pattern as HW3) For each postfix expression, due the following: 1. Build an expression tree supporting +-*/ 2. Print out the equivalent infix expression, in…

You’ll get a: . zip file solution

 

 
Categorys:

Description

5/5 – (2 votes)

For this assignment you will write a program that reads postfix expression from the user, one per line, terminating when the user enters a blank line.

(Follow the same input pattern as HW3)

For each postfix expression, due the following:

1. Build an expression tree supporting +-*/

2. Print out the equivalent infix expression, in heavily parenthesesed form.

3. Print out the numeric value of the expression.

10pt Bonus: support variables in expressions, introducing an = (assignment) operator to intro-duce/initialize new variables. Save variables between evaluations.

I am here to give as much help as needed!

Turn in. . .

Make sure your main method is in a class called ETreeDriver. Do not print any prompts or values other than the infix expression and resulting value.

Do not worry about invalid expressions.

Java files with your name in comments at the top of each.

Code must compile to be worth points.

Assignment must be submitted by the due date to be eligible for bonus points.