Task
You have to create a Calculator app. It should solve simple math expressions with integers, i.e.:
(2 + 3) * 4
All the operations should be calculated according to their math precedence.
Optional:
- Add history of calculations that should be stored in a standard Java collection
- Add commands 'history' and 'history unique' that show history of calculations and history whithout duplicates
- Add the 'exit' command
- Add the 'operators' command which shows the list of allowed math operators
- Your algorithm should be friendly to adding new operators
The description of app work
A user runs the app and types an expression to calculate. The application returns the evaluated
result and prompt to either do another calculation or exit.
Incoming parameters
A string that represents a simple math expression that can be empty ot contain an invalid expression.
Result
The result of the evaluated expression or error message otherwise.