Skip to content

Hindu309/JavaCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Java Console Calculator

A simple calculator built in Java using the console (terminal). This calculator supports the following operations:

  • Addition
  • Subtraction
  • Multiplication
  • Division (with zero-division handling)

πŸ›  Features

  • Console-based input/output
  • Error handling for division by zero
  • Clean and modular code with static methods for operations

πŸ“‚ Project Structure

JavaCalculator/ └── src/ └── task1/ └── Calculator.java

markdown Copy code

πŸš€ How to Run

Prerequisites:

  • Java JDK installed (version 8 or later)
  • Eclipse IDE or any Java IDE

Steps:

  1. Clone the repository:
    git clone https://github.com/Hindu309/JavaCalculator.git

Open the project in Eclipse:

Go to File > Open Projects from File System

Select the folder where you cloned the repo

Run the Calculator.java file:

Right-click on the file > Run As > Java Application

βœ… Example Usage

Copy code ===== Java Console Calculator ===== Enter first number: 10 Enter second number: 2 Choose operation:

  1. Add
  2. Subtract
  3. Multiply
  4. Divide Enter choice: 4 Result: 5.0

About

Java console calculator using methods, Scanner, and loops

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages