This Calculator Application is a Java-based program designed to perform basic arithmetic operations. It follows the MVC (Model-View-Controller) architecture, ensuring a clean separation of concerns between user interface, business logic, and data handling.
Reverse Polish Notation (RPN) is a method of mathematical expression that differs significantly from the conventional algebraic notation. In standard notation, operators are typically placed between operands, like in the expression 3 + 4
. In contrast, RPN places operators after their operands. For the same expression in RPN, it would be written as 3 4 +
. This format eliminates the need for parentheses to define the order of operations. In an RPN system, the calculation is performed in the order the elements appear, working from left to right, applying each operator to the operands that immediately precede it. This makes RPN particularly efficient and reduces the cognitive load in complex calculations, as the order of operations is explicit and does not rely on operator precedence rules. RPN is often used in scientific and financial calculators due to its efficiency in handling complex expressions.
To run this game, ensure you have Java and JavaFX installed on your system.
- Java JDK 8 or above
- JavaFX SDK
- Clone the repository to your local machine.
- Navigate to the project directory.
- Compile the Java files:
javac -cp path/to/javafx-sdk/lib --add-modules javafx.controls INSERT MODULES
. - Run the Main class:
java -cp path/to/javafx-sdk/lib --add-modules javafx.controls Main
Note: Modify the paths to compile the Java Files using JavaFX SDK according to the actual location of your JavaFX SDK.
The project consists of the following key components:
-
Main.java
- The main entry point of the application. It is responsible for initializing and launching the calculator.
-
CalculatorGUI.java
- Manages the graphical user interface (GUI) of the calculator. This component presents information to the user and captures user input.
-
CalculatorModel.java
- Handles the data and core logic of the calculator, such as performing calculations and storing results.
-
CalculatorControler.java
- Contains the logic for controlling calculator operations. This component acts as an intermediary between the Model and GUI.
In addition to these, there are corresponding interface files (CalculatorControlerInterface.java
, CalculatorModelInterface.java
, CalculatorGUIInterface.java
) that define essential methods for each component. Also, an application.css
file is included for styling the GUI.
To run the application:
- Ensure you have Java installed on your system.
- Compile the Java files.
- Run
Main.java
.
RPN Calculator Interface
This project is open for contributions. Please adhere to standard coding practices when making changes or additions. For questions or feedback, please contact me at [email protected]!
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.