Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Modern Java Calculator – College OOPS Mini Project

A simple yet modern calculator built using Java Swing for the Object-Oriented Programming (OOPS) mini project in college. It supports basic arithmetic operations, square roots, exponentiation, and modulus, along with keyboard input for an enhanced user experience.

Demo

This calculator supports interactive functionality through both GUI buttons and keyboard inputs, making it easy to use for all types of users.

Features

  • Basic Arithmetic Operations - Addition, subtraction, multiplication, division.
  • Square Root Calculation - Computes the square root of a number.
  • Exponentiation - Raise a number to a power (^).
  • Percentage Calculation - Calculate percentages and modulus.
  • Keyboard Input - Supports keyboard shortcuts for entering numbers and operations.
  • Clear Button (C) - Clears the display using either the button or the C key on the keyboard.
  • Result Calculation (=) - Computes the result by pressing the Enter key or the = button.
  • Backspace - Removes the last entered character using the Backspace key.

Technologies Used

  • Java - Object-Oriented Programming (OOP) principles.
  • Java Swing - For the graphical user interface (GUI).
  • Event Handling - For handling user interactions via both mouse clicks and keyboard events.

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine:

# Clone the repository
git clone https://github.com/Roshan-Bhadane/Calculator_in_Java.git

# Navigate to the project directory
cd Calculator_in_Java

# Compile and run the project
javac ModernCalculator.java
java ModernCalculator

Folder Structure

β”œβ”€β”€ ModernCalculator.java    # Main Java source file
β”œβ”€β”€ README.md                # Project documentation
└── LICENSE                  # MIT License file (optional)

Usage

Basic Operation

  1. Launch the application.
  2. Use the GUI buttons or keyboard to enter numbers and operators.
  3. Press the C button or C key to clear the display.
  4. Press the Enter key or = button to calculate the result.
  5. Press the Backspace key to delete the last entered character.

Keyboard Shortcuts

  • Enter - Calculate the result (same as clicking =)
  • Backspace - Delete the last entered character
  • C - Clear the display

Screenshots

Here’s a screenshot of the Modern Java Calculator:

Calculator Screenshot

Contributing

Contributions are welcome! If you'd like to suggest improvements or contribute code, please fork the repository and create a pull request with your changes. You can also open issues to report bugs or suggest new features.

Author

Roshan Bhadane

About

πŸ–₯️ **Modern Java Calculator** – Sleek & easy-to-use | Basic βž• & advanced πŸ”’ operations | Keyboard ⌨️ & mouse support πŸ–±οΈ | Clear 🧹 & calculate 🎯

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages