Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

SimpleCalculator A simple calculator application

Here’s a polished README.md written in clean GitHub-friendly Markdown that clearly explains your Java calculator program:

📘 Simple Java Calculator A basic command-line calculator written in Java. It allows the user to enter two numbers and choose an arithmetic operation (Addition, Subtraction, Multiplication, or Division). The program then prints the result or an appropriate error message.

🚀 Features Accepts two numeric inputs from the user

Supports four operations:

Addition Subtraction Multiplication Division (with division-by-zero handling) Clear prompts and console output

Lightweight and beginner-friendly

🧩 Code Overview The program:

Uses Scanner to read user input Prompts for two numbers Displays a menu of operations Performs the selected operation using simple conditional statements (if-else) Handles division by zero gracefully Prints the computed result 📦 How to Run Prerequisites Java Development Kit (JDK 8+) Steps Save the file as:

Calculator.java Compile the program:

javac Calculator.java Run the program:

java Calculator 🖥️ Sample Output Enter the first number 10 Enter the second number 5 Choose an operation

  1. Addition
  2. Subtraction
  3. Multiplication
  4. Division

About

Simple Java Calculator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages