Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.38 KB

README.md

File metadata and controls

34 lines (24 loc) · 1.38 KB

Calculator Program

This is a simple calculator program implemented using HTML, CSS, and JavaScript. It allows users to perform basic arithmetic operations such as addition, subtraction, multiplication, and division.

Features

  • User-friendly interface with responsive design.
  • Buttons for numbers (0-9), decimal point, and arithmetic operators (+, -, *, /).
  • Clear button to reset the calculation.
  • Uses local storage to persist the calculation across sessions.

Usage

  1. Clone or download the repository to your local machine.
  2. Open the index.html file in your web browser.
  3. Use the buttons to input numbers and perform calculations.
  4. Click the "=" button to see the result.
  5. Use the "Clear" button to reset the calculation.

Code Structure

  • index.html: Contains the HTML structure of the calculator.
  • style.css: Defines the styles for the calculator interface.
  • script.js: Contains the JavaScript code for handling calculations and user interactions.

How it Works

  • The updateCalculation(value) function in script.js updates the calculation string based on user input.
  • The displayResult(message) function displays the calculation result in the designated paragraph.
  • Local storage is used to store and retrieve the calculation, ensuring persistence across page reloads.

Screenshots

IMAGE 1: Calculator Page