Build a basic calculator using Java that performs:
- Addition
- Subtraction
- Multiplication
- Division
It uses Java console input/output and runs in a loop until the user exits.
- Java (JDK 24)
- Eclipse IDE
- Git & GitHub
- Open Eclipse IDE
- Create a new Java Project:
File → New → Java Project → Name it as 'Task1' - Create a new class:
Right-click 'src' → New → Class → Name it as 'SimpleCalculator' and check "public static void main" - Write the code in 'SimpleCalculator.java'
- Run the program:
Right-click on the file → Run As → Java Application - Use the terminal in Eclipse to input numbers and choose operations.
- Java Syntax
- Static Methods
- Conditionals
- Loops (while)
- Scanner class for input
- Exception handling (divide-by-zero)
- Console Output