Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 939 Bytes

File metadata and controls

36 lines (30 loc) · 939 Bytes

JavaSimpleCalculator

Objective

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.

Tools Used

  • Java (JDK 24)
  • Eclipse IDE
  • Git & GitHub

How to Run the Project in Eclipse

  1. Open Eclipse IDE
  2. Create a new Java Project:
    File → New → Java Project → Name it as 'Task1'
  3. Create a new class:
    Right-click 'src' → New → Class → Name it as 'SimpleCalculator' and check "public static void main"
  4. Write the code in 'SimpleCalculator.java'
  5. Run the program:
    Right-click on the file → Run As → Java Application
  6. Use the terminal in Eclipse to input numbers and choose operations.

Key Concepts Practiced

  • Java Syntax
  • Static Methods
  • Conditionals
  • Loops (while)
  • Scanner class for input
  • Exception handling (divide-by-zero)
  • Console Output