Skip to content

rowanvictor01/web-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Web Calculator

A beginner-friendly web calculator built using vanilla JavaScript, HTML, and CSS. This project was created as part of my learning journey to deepen my understanding of DOM manipulation, user input handling, and application state logic in JavaScript.

🚀 Live Demo

Click here to try it out


✨ Features

  • Click-based input for numbers and basic operators
  • Supports addition, subtraction, multiplication, and division
  • Only allows a single decimal point per number
  • Handles input validation and updates the display in real time
  • Modular arithmetic operations
  • Pressing = computes the result based on the last operator and operands
  • Clean and readable layout (initial version)

🔧 Planned Improvements & Fixes

  • Refactor the long registerInput() function into an object-based dispatch pattern using for...in
  • Add a division by zero guard
  • Add a Clear button that deletes characters one by one (like backspace)
  • Add an All Clear (AC) button that the resets caclulator
  • Add a history log to display past equations and results
  • Improve UI and layout with better styling and responsive design

🛠️ Technologies Used

  • HTML5
  • CSS3
  • JavaScript (ES6+)
  • DOM API