Skip to content

SnehaChakraborti/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

calculator

Calculator Project README

Project Description

The calculator project is a web-based application that allows users to perform basic arithmetic calculations. It provides a user-friendly interface where users can input numbers and perform operations such as addition, subtraction, multiplication, and division. The project aims to demonstrate the use of HTML, CSS, and JavaScript to build interactive and functional applications.

Project Structure

The project follows a basic structure with separate files for HTML, CSS, and JavaScript:

  • index.html: This file contains the structure and layout of the calculator user interface. It includes the necessary HTML elements such as buttons and display area.

  • styles.css: The CSS file defines the styling and appearance of the calculator. It specifies the colors, fonts, dimensions, and positioning of various elements.

  • script.js: The JavaScript file handles the logic and functionality of the calculator. It defines event handlers for button clicks, performs the arithmetic operations, and updates the display accordingly.

Usage

To use the calculator, simply open the index.html file in a web browser. The calculator interface will be displayed, consisting of numeric buttons, operator buttons, a clear button, and a display area.

  • Clicking on the numeric buttons will append the corresponding digit to the display.

  • Operator buttons perform the selected operation on the numbers entered. For example, clicking the "+" button will add the current number on the display to the previous number.

  • The clear button resets the calculator, clearing the display and any stored values.

Development

If you want to modify or enhance the calculator project, follow these steps:

  1. Clone the project repository or create a new project directory.
  2. Open the project in your preferred code editor.
  3. Make changes to the HTML structure in index.html for any modifications to the user interface.
  4. Update the styles in styles.css to customize the appearance of the calculator.
  5. Modify the JavaScript logic in script.js to add new features or change the existing behavior.
  6. Test the changes by opening index.html in a web browser.
  7. Iterate and refine your modifications as needed.