Skip to content

Sudharsansm/CalculatorJavaApplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ About This Project

This is not just another calculator. This project was built as part of my journey to master Java fundamentals, explore console-based input/output, and strengthen my understanding of methods, loops, and modular programming.

Itโ€™s designed to show how a small program can elegantly combine logic, error handling, and user interaction.

I built this project to challenge myself:

Can I make a calculator that doesnโ€™t crash even if a user divides by zero? Can I structure the code so each operation has its own clear method? Can I keep the user experience simple but robust? The result is a clean, menu-driven console calculator that keeps running until the user chooses to exit.

๐ŸŒŸ Features & Highlights

Modular Methods: Each operation (add, subtract, multiply, divide) is encapsulated in its own method for clarity and reusability. Dynamic User Input: Uses Scanner to take user inputs at runtime. Error Handling: Division by zero is caught gracefully with a user-friendly message. Loop-Driven Menu: The calculator allows continuous operations until the user decides to quit. Human-Centric Design: Designed for real usersโ€”no crashes, just smooth calculations.

๐ŸŽฏ Learning Outcomes

Through this project, I deepened my knowledge of:

Java Syntax & Methods: Writing clean, readable, and reusable code Conditional Logic & Loops: Building interactive programs that respond to user input Error Handling: Predicting and handling runtime errors like divide-by-zero Practical Programming Mindset: Writing code that is easy to maintain and extend

๐Ÿ›  Tools & Setup

Language: Java (JDK 8+) Editor/IDE: Eclipse / VS Code / IntelliJ IDEA CE Execution: Terminal / Command Prompt

OutPut

Simple Calculator

Choose operation:

  1. Add
  2. Subtract
  3. Multiply
  4. Divide
  5. Exit Enter Your Choice: 1 Enter first number: 10 Enter second number: 25 Result: 35.0

Choose operation:

  1. Add
  2. Subtract
  3. Multiply
  4. Divide
  5. Exit Enter Your Choice: 2 Enter first number: 10 Enter second number: 20 Result: -10.0

Choose operation:

  1. Add
  2. Subtract
  3. Multiply
  4. Divide
  5. Exit Enter Your Choice: 3 Enter first number: 10 Enter second number: 20 Result: 200.0

Choose operation:

  1. Add
  2. Subtract
  3. Multiply
  4. Divide
  5. Exit Enter Your Choice: 4 Enter first number: 10 Enter second number: 20 Result: 0.5

Choose operation:

  1. Add
  2. Subtract
  3. Multiply
  4. Divide
  5. Exit Enter Your Choice: 5 Exiting. Thanks!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages