A simple Java-based calculator that performs basic arithmetic operations: addition, subtraction, multiplication, and division. It includes error handling and user-friendly input validation, making it a great project for beginners learning Java.
- Perform basic arithmetic operations:
+
,-
,*
,/
. - Handles division by zero with appropriate error messages.
- Simple and intuitive command-line interface.
- Organised with a proper package structure.
- Java Development Kit (JDK) 8 or later installed.
- A code editor or IDE such as IntelliJ IDEA, Eclipse, or VS Code.
- Clone the repository:
git clone https://github.com/nurulashraf/java-basic-calculator.git
- Navigate to the project directory:
cd java-basic-calculator
- Compile the code:
javac src/Calculator.java
- Run the program:
java -cp src calculator.Calculator
java-basic-calculator/
├── src/
│ └── Calculator.java # Main program file
├── LICENSE # MIT License
└── README.md # Project documentation
Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request. For significant changes, feel free to open an issue to discuss them first.
This project is licensed under the MIT License.