https://github.com/adamouization/srpn
:heavy_plus_sign: :heavy_minus_sign: :heavy_multiplication_x: :heavy_division_sign: Reverse Polish Notation Calculator (2015)
https://github.com/adamouization/srpn
calculator java reverse-polish-notation
Last synced: over 1 year ago
JSON representation
:heavy_plus_sign: :heavy_minus_sign: :heavy_multiplication_x: :heavy_division_sign: Reverse Polish Notation Calculator (2015)
- Host: GitHub
- URL: https://github.com/adamouization/srpn
- Owner: Adamouization
- Created: 2016-12-06T23:00:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-20T09:23:39.000Z (about 8 years ago)
- Last Synced: 2025-01-05T01:43:04.999Z (over 1 year ago)
- Topics: calculator, java, reverse-polish-notation
- Language: Java
- Homepage:
- Size: 47.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SRPN (Reverse Polish Notation Calculator)
This program is a [Reverse Polish Notation Calculator](https://en.wikipedia.org/wiki/Reverse_Polish_notation) written in Java.
### Screenshot

## Instructions
In reverse Polish notation, the operators follow their operands; for instance, to add 3 and 4, one would write `3 4 +` rather than `3 + 4`.
If there are multiple operations, operators are given immediately after their second operands; so the expression written `3 − 4 + 5` in conventional notation would be written `3 4 − 5 +` in reverse Polish notation: 4 is first subtracted from 3, then 5 is added to it.
An advantage of reverse Polish notation is that it removes the need for parentheses that are required by infix notation. While `3 − 4 × 5` can also be written `3 − (4 × 5)`, that means something quite different from `(3 − 4) × 5`. In reverse Polish notation, the former could be written `3 4 5 × −`, which unambiguously means `3 (4 5 ×) −` which reduces to `3 20 −`; the latter could be written `3 4 − 5 ×` (or `5 3 4 − ×`, if keeping similar formatting), which unambiguously means `(3 4 −) 5 ×`.
*(from [Wikipedia](https://en.wikipedia.org/wiki/Reverse_Polish_notation))*
## Installation
1. Clone the project: `git clone https://github.com/Adamouization/SRPN`
2. Cd into the directory and compile the files, then run the source code:
```
cd SRPN
javac SRPN.java
java SRPN.java
```
## Contact
* email: adam@jaamour.com
* website: www.adam.jaamour.com
* twitter: [@Adamouization](https://twitter.com/Adamouization)