Skip to content

Latest commit

Β 

History

History
28 lines (23 loc) Β· 1.5 KB

README.md

File metadata and controls

28 lines (23 loc) Β· 1.5 KB

Simple Java Calculator

Description

This is a basic calculator application built using Java. It supports standard arithmetic operations such as addition, subtraction, multiplication, and division, as well as advanced functions like factorial, power, square root, and natural logarithm.

Features

  • Basic Operations: Add, Subtract, Multiply, Divide.
  • Advanced Functions: Factorial, Power, Square Root, Natural Logarithm.
  • Graphical User Interface (GUI): Built using Java Swing.

Files

  • Calculator.java: Contains the core logic for the calculator operations.
  • GUI.java: Implements the graphical user interface and handles user interactions.

Usage

  • Enter numbers and select an operation using the GUI.
  • Click the equals (=) button to compute the result.
  • Use the C button to clear the input.

Example Operations

  • Addition: Enter the first number, click +, enter the second number, and click =.
  • Subtraction: Enter the first number, click -, enter the second number, and click =.
  • Multiplication: Enter the first number, click *, enter the second number, and click =.
  • Division: Enter the first number, click /, enter the second number, and click =.
  • Factorial: Enter a number and click ! to get its factorial.
  • Power: Enter the base, click POW, enter the exponent, and click =.
  • Square Root: Enter a number and click SQRT to find its square root.
  • Natural Logarithm: Enter a number and click ln to get its natural logarithm.