Skip to content

Ramez-Ibrahim/Calculator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

This is a responsive calculator web application built using React. It allows users to perform both basic and advanced arithmetic operations, such as addition, subtraction, multiplication, division, and a variety of scientific calculations.

Calculator Demo

Features

  • Basic arithmetic operations: addition, subtraction, multiplication, and division
  • Clear the calculator's display
  • Delete the last character entered
  • Input decimal numbers
  • View the previous and current operands
  • Get the computed result using React state
  • Scientific calculator functions:
    • Parentheses: () for grouping operations
    • EE (Exponent)
    • Trigonometric functions: tan, cos, sin and their inverse functions (tan⁻¹, cos⁻¹, sin⁻¹)
    • Exponential and logarithmic functions: 10^x, ln, log
    • Factorial: x!
    • Euler's number: e
    • Square root:
    • Squaring:
    • Cube:
    • Pi constant: π
    • Reciprocal: 1/x
  • Responsive design: Works on desktop and mobile devices

Purpose

This calculator was created to showcase my skills in building a responsive React application. It demonstrates my understanding of React components, state management, advanced event handling, and dynamic UI updates. The scientific functions also highlight my ability to implement complex calculations and user interaction flows.

Getting Started

To use the calculator locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Ramez-Ibrahim/calculator.git
  2. Navigate to the project directory and install dependencies:

    cd src
    npm install
  3. Start the development server:

    npm start
  4. Open the application in your web browser at http://localhost:3000.

Usage

  • Click the number buttons to input digits.
  • Click the operation buttons to select the desired operation.
  • Use the scientific calculator buttons for advanced calculations:
    • () for parentheses
    • EE for exponents
    • Trigonometric functions: tan, cos, sin and their inverses (tan⁻¹, cos⁻¹, sin⁻¹)
    • 10^x, ln, log for logarithmic and exponential calculations
    • Factorials: x!
    • e for Euler's number
    • Square root: , squaring: , cubing:
    • π for Pi constant
    • 1/x for reciprocals
  • Click the "=" button to compute the result.
  • Click the "AC" button to clear the calculator's display.
  • Click the "DEL" button to delete the last character entered.

Customization

You can customize the calculator's styling by modifying the App.css file. Adjust the colors, sizes, and layout to match your preferences. The calculator is designed to be responsive, ensuring that it looks great on both desktop and mobile devices.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

Transforms Numbers Into Answers 🧮

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.5%
  • CSS 22.2%
  • HTML 8.3%