Skip to content

dedsocks/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

๐Ÿงฎ Calculator

This project is a simple calculator built as the final project of the Foundations Course from The Odin Project
It can perform basic arithmetic operations and accepts both button clicks and keyboard input.


๐ŸŽจ Preview

calculator preview


๐Ÿš€ Features

  • Operates on numbers with a sign (positive/negative).
  • Supports the basic arithmetic operators: +, -, ร—, รท.
  • Handles floating point numbers using the . button.
  • Accepts keyboard input for faster usage.
  • DEL button deletes one number at a time.
  • CLEAR button clears the entire input.

โŒจ๏ธ Keyboard Shortcuts

  • Backspace โ†’ acts as DEL (delete one element).
  • Number keys (0โ€“9) โ†’ input numbers.
  • Arithmetic keys (+ - * /) โ†’ input operators.
  • Enter / = โ†’ evaluates the expression.

๐Ÿ“š Learnings

  • Initially, a flag variable was used to determine which number should be taken as input.
    As the project grew, managing this flag became messy so I had to find a different approach.
  • Refactored the logic to depend on the operator state, which was much easier to track and extend.
  • This was my first attempt at responsive design. The calculator currently renders smaller than expected on some devices, but improving responsiveness will be a focus for future updates.

๐Ÿ‘จโ€๐Ÿ’ป Author

Made by Shaun ๐Ÿ˜Š

About

This project is a simple calculator built as the final project of the Foundations Course from The Odin Project It can perform basic arithmetic operations and accepts both button clicks and keyboard input.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors