Question: cse 2 1 2 3 data structures using java final project using java final project NOTE: YOU MAY ONLY SUBMIT ONE FINAL PROJECT! When we

cse 2123 data structures using java final project
using java final project
NOTE: YOU MAY ONLY SUBMIT ONE FINAL PROJECT!
When we hear the word language we often think of English, Spanish, Chinese, Swahili, or other so-called natural languages. It may be surprising, then, to hear that the field of mathematics has an entire area of study around languages and what they can express. The mathematical definition of a language is likely much broader than ones intuitive conception of the term, but this broadness comes with benefits! One specific benefit is that mathematical expressions can be defined as following particular grammar rules. The result of all that is that we can parse through and evaluate a math expression of any length.
For this project, we will be creating a calculator that can evaluate slightly simplified expressions. Specifically, we will be tackling expressions in a format known as reverse polish notation (or simply postfix notation). Although organizing math equations like Yoda speaks in Star Wars might seem unintuitive, there are multiple benefits. The most important benefit is that we can avoid having to worry about parentheses and traditional parsing, because the format of the expression enforces which operators should be evaluated first.
Instructions
For this project, the input and the output will be simple: we will take as input an expression written in postfix notation, we will output the expression in traditional notation (also known as infix notation) as well as what that expression evaluates to. This process will repeat until the user enters nothing, and the program quits.
Here are three example input and output combinations from running the program (user input in bold):
Please input an expression formatted in postfix notation (or blank to quit): 55=5 Please input an expression formatted in postfix notation (or blank to quit): 34-(3-4)=-1 Please input an expression formatted in postfix notation (or blank to quit): 34*56*+((3*4)+(5*6))=42 Please input an expression formatted in postfix notation (or blank to quit): 1234-+*(1*(2+(3-4)))=1 Please input an expression formatted in postfix notation (or blank to quit): Goodbye!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!