This program is basic calculator program using java console I/O.
This project demonstrates a basic console-based calculator built using Java.
It allows the user to perform addition, subtraction, multiplication, and division using methods and console input/output.
- Java (JDK)
- VS Code
- Terminal
Calculator.java– Java source code implementing the calculator.
- Open Terminal in the project folder.
- Compile the program:
javac Calculator.java
=== Basic Calculator ===
Choose operation:
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Exit Enter your choice (1-5): 1 Enter first number: 10 Enter second number: 5 Outcome Result = 15.0
Choose operation:
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Exit Enter your choice (1-5): 4 Enter first number: 9 Enter second number: 0 Division by zero is not possible! Outcome Result = NaN
Choose operation:
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Exit Enter your choice (1-5): 5 Exiting calculator.