Skip to content

addy015/BasicCalculator-UnifiedMentor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Calculator

Overview

A sleek web-based calculator built with HTML, CSS, and JavaScript, handling basic arithmetic and percentage calculations.

Features

  • Arithmetic: +, -, *, / for core math operations
  • Percentage: % for quick percentage computations
  • Clear: C resets everything
  • Backspace: removes the last character
  • Keyboard Support: Type directly for ease
  • Responsive Design: Works on any device

How to Use

  1. Setup
    • Place index.html, style.css, and script.js in one folder
    • Open index.html in a browser (Chrome, Firefox, etc.)
  2. Operations
    • Input: Click or type 0-9, . for numbers
    • Math: Use +, -, *, / buttons or keys
    • Result: Hit = or Enter to calculate
    • Reset: C or c clears display
    • Delete: or Backspace removes last input
  3. Percentage (Additional Feature)
    • Add/Subtract: 100 + 20% =120
    • Multiply: 200 * 25% =50
  4. Keyboard
    • Numbers: 0-9, .
    • Operators: +, -, *, /, (, )
    • Other: %, Enter (calculate), Backspace (delete), c (clear)

Notes

  • Errors: Shows "Error" or "Infinity" for invalid inputs (e.g., divide by zero)
  • Precision: Decimals rounded to 4 places
  • Brackets: Auto-handles and closes brackets
  • Styling: Clean white base, subtle shadow, rounded buttons, red operators, blue hover effects

Requirements

  • Modern browser (e.g., Chrome, Firefox, Safari, Edge)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors