Overview This is a simple console-based calculator application developed in Java. The calculator supports basic arithmetic operations including addition, subtraction, multiplication, and division. Users can interact with the application through a text-based menu.
Features Addition: Adds two numbers. Subtraction: Subtracts the second number from the first. Multiplication: Multiplies two numbers. Division: Divides the first number by the second (with error handling for division by zero). User -Friendly Interface: A simple menu-driven interface for easy navigation. Continue or Exit: Users can choose to perform multiple calculations or exit the application.
Requirements Java Development Kit (JDK) 8 or higher A terminal or command prompt to run the application
How to Run the Application Clone the Repository: git clone https://github.com/yourusername/calculator.git cd calculator
Compile the Java Program: javac calculator.java
Run the Application: java calculator
Follow the On-Screen Instructions: Select an operation by entering the corresponding number. Input the required numbers when prompted. Choose to continue or exit after each operation.
Example Usage Calculator
==========
- Addition
- Subtraction
- Multiplication
- Division
- Exit
Enter your choice: 1 Enter number 1: 5 Enter number 2: 3 Addition of the two numbers is 8
Do you want to continue(y/n): y
Error Handling The application checks for division by zero and provides an appropriate message. Invalid choices in the menu prompt an error message.
Contributing Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.
License This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments Inspired by the need for a simple calculator application. Thanks to the Java community for their resources and support.