Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I want to solve this problem in Java for the entire project. COMP 2 4 2 - Project II In this project, you will implement
I want to solve this problem in Java for the entire project.
COMPProject II
In this project, you will implement an
equation processor application using
linked stack and cursor array
implementations of a linked list. The
equation processor interface will look like
the following:
The equation file is a special text file
that has a extension. The equations in
this file are in infix andor postfix format. A
typical equation file looks like the following:
File: c:IdatalDSProj
Equation Section
Infix:
Postfix:
Prev
The equations file has to
start with the tag and
ends with the tag
Within the start and end tags
there are or more sections.
Section starts with tag.
Within a section there are an
optional infix andor postfix
sections. Infix starts with tag.
Postfix starts with tag.
Inside the infixpostfix sections
you find or more equations.
Equation starts with
nfix: equation
At start, the user has to click the Load button. The load button will open a file chooser to select an
equation file. The selected file will be displayed in the label next to the load button eg c:dataDSProj and then the file contents will be loaded as shown in previous figure if the file is
valideg tags are balanced
Valid file: you need to check and indicate whether the file tags are balanced or not. Meaning that
each start tag has an end tag and they are closed in order.
Note: This can be done using a stack similar to the balanced delimiters in equations.
In the Equation Section you need to load equations from the st section from the file.
For Infix equations: do convert the infix to postfix and then evaluate it
For postfix equations: do convert the postfix to prefix and then evaluate it As shown in the
previous figure.
Note: we didnt cover prefix in lectures. You need to study it by yourself.
At last, the Prev and Next buttons will navigate through equation section. If you click the Next button,
it will display the equations from the nd section in the file if exists and so on If you click the Prev
button, it will display the equations from the previous section in the file if exists.
To make the project more interesting:
We need you to implement the linked stack using a
cursor array.
You have to define course array and within this cursor
array you can create as many stacks as needed.
Yahoooo!
Step 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