Skip to content

kesavanaswin/Simple-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Calculator

A basic web-based calculator built with HTML, CSS, and JavaScript. This project allows users to perform fundamental arithmetic operations such as addition, subtraction, multiplication, division, and modulus through a simple and intuitive interface.

Features

  • Supports basic arithmetic operations: addition (+), subtraction (-), multiplication (*), division (/), and modulus (%).
  • Clear button (C) to reset the display.
  • Responsive design for use on various screen sizes.
  • User-friendly interface with a dark theme and hover effects on buttons. -Error handling for invalid inputs (e.g., division by zero).

Technologies Used

  • HTML: Structures the calculator's user interface.
  • CSS: Styles the layout, display, and buttons for a clean and modern look.
  • JavaScript: Implements the calculator's logic, including button interactions and expression evaluation.

Getting Started

Prerequisites

  • A modern web browser (e.g., Chrome, Firefox, Edge).
  • No additional software or dependencies are required.

Installation

Clone the repository:

git clone https://github.com/kesavanaswin/Simple-Calculator.git

Navigate to the project directory:

cd Simple-Calculator

Open index.html in a web browser to use the calculator.

Usage

  • Click the number buttons (0-9) to input digits.
  • Use the operator buttons (+, -, *, /, %) to build expressions.
  • Press the equals button (=) to evaluate the expression.
  • Use the clear button (C) to reset the display.

Project Structure

  • index.html: Contains the HTML structure for the calculator's interface.
  • style.css: Defines the styling for the calculator, including layout and button design.
  • script.js: Handles the logic for button clicks, expression evaluation, and error handling.

Limitations

  • Uses JavaScript's eval() function for expression evaluation, which is suitable for this simple application but not recommended for handling untrusted inputs in production environments.
  • Limited to basic arithmetic operations; no support for advanced functions like square roots or memory storage.

Contributing

Contributions are welcome! To contribute:

  • Fork the repository.
  • Create a new branch (git checkout -b feature-branch).
  • Make your changes and commit (git commit -m "Add new feature").
  • Push to the branch (git push origin feature-branch).
  • Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • Built as a learning project for web development with HTML, CSS, and JavaScript.
  • Inspired by simple calculator designs for educational purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors