The Java Calculator is a simple command-line calculator application written in Java that performs basic arithmetic operations such as addition, subtraction, multiplication, and division. It's designed to help you quickly perform calculations without the need for a graphical user interface.
- Addition: Perform addition of two or more numbers.
- Subtraction: Perform subtraction of one number from another.
- Multiplication: Perform multiplication of two or more numbers.
- Division: Perform division of one number by another (handles division by zero).
Follow these steps to get started with the Java Calculator:
-
Clone the repository:
git clone https://github.com/Jinan47/Java-Calculator.git
-
Compile the code:
Navigate to the project directory and compile the Java code using the following command:
calculator.java
-
Run the calculator:
Run the compiled Java code using the following command:
java calculator
-
Perform calculations:
Once the calculator is running, follow the on-screen instructions to input numbers and choose the desired operation. The calculator will display the result of the operation.
- Enter the first number:
5 - Select an operation (+, -, *, /):
+ - Enter the second number:
3 - Result:
5 + 3 = 8
- Addition:
10 + 20 = 30 - Subtraction:
50 - 25 = 25 - Multiplication:
5 * 6 = 30 - Division:
100 / 4 = 25
Contributions are welcome! If you find any issues or want to enhance the calculator's functionality, feel free to open a pull request. Please ensure you follow the existing coding style and provide a detailed description of the changes you've made.
Happy calculating! If you have any questions or suggestions, feel free to open an issue. We hope you find this Java Calculator useful for your basic arithmetic calculations.