Skip to content

🧮 Programmer calculator with Hex, Decimal & Binary modes | Bitwise operations support | Built with Java Swing

Notifications You must be signed in to change notification settings

EgeGermen/ProgrammerCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Programmer Calculator

Author: Ege Germen

Overview

This project is a versatile and user-friendly calculator designed specifically for programmers. Developed using Java's Swing framework for the graphical user interface, it provides essential functionalities for developers working with different number systems. The calculator allows users to perform both standard arithmetic calculations and complex bitwise operations, seamlessly switching between Hexadecimal, Decimal, and Binary modes.

Features

The calculator's interface is designed for efficiency and clarity, with dedicated buttons for different operations and number systems.

Number Systems

  • Hexadecimal Mode: Allows input of numbers 0-9 and A-F. All calculations and results are displayed in hexadecimal format.
  • Decimal Mode: Standard base-10 calculations. Bitwise operations are disabled in this mode.
  • Binary Mode: Allows input of only 0 and 1. All calculations and results are displayed in binary format.

Operations

Arithmetic Operations

  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)

Bitwise (Logical) Operations

  • AND: Bitwise AND operation.
  • OR: Bitwise OR operation.
  • XOR: Bitwise XOR (exclusive OR) operation.
  • NOT: Bitwise NOT (inversion) operation.
  • Left Shift (<<): Shifts the bits of the first operand to the left by the number of positions specified by the second operand.
  • Right Shift (>>): Shifts the bits of the first operand to the right by the number of positions specified by the second operand.

Interface

  • Display Screen: A clear, non-editable text field at the top shows the current input and results.
  • Mode Selection: Radio buttons allow for easy switching between Hexadecimal, Decimal, and Binary modes.
  • Dynamic Button Layout: The calculator intelligently enables and disables buttons based on the selected mode. For instance, hexadecimal buttons (A-F) are only active in Hexadecimal mode, and number buttons (2-9) are disabled in Binary mode.
  • Clear Button: A prominent "Clear" button to reset the current calculation.

How to Run

To compile and run this application, you need to have the Java Development Kit (JDK) installed on your system.

  1. Open your terminal or command prompt.
  2. Navigate to the directory where ProgrammerCalculator.java is saved.
  3. Compile the Java source file:
    javac ProgrammerCalculator.java
  4. Run the compiled Java application:
    java ProgrammerCalculator

This will launch the calculator in a new window.

About

🧮 Programmer calculator with Hex, Decimal & Binary modes | Bitwise operations support | Built with Java Swing

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages