Question
programin with java Create an application that can evaluate an infixed expression by using the Generic Stack structure then print out the result in the
programin with java
Create an application that can evaluate an infixed expression by using the Generic Stack structure then print out the result in the following format:
For example
Read an infixed expression,
(1 + 2) * 4 3
The output should be: (1 + 2) * 4 3 = 9
The application should allow users to choose where to read the expression: from the keyboard or from a file (file stores one expression on one line)
After finishing one expression, the application should loop back to allow users to select the source to read the expression from then continue to do until the users want to exit
Add a class GenericStack that can apply for any data type. You can use the code of GenericStack in the book page 167 for your reference
Add the driver class named InfixedExpression that has 5 user defined functions, one function of phase 1, one function for phase 2, one function of process One Operation, one function for procesOneExpression and one function for display output
1. public class GenericStackStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started