Skip to content

fffear/javascript-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Calculator Project from "The Odin Project"

This project is to make a completely functional calculator using javascript. View Here

In order to build the calculator, I used a combination of html, css and javascript.

Features

  • Completely functional basic calculator
  • Intuitive Design
  • Intuitive Keyboard support
  • Error message when trying to divide by zero
  • Disallows multiple operators to be entered consecutively
  • Allows calculation of multiple operands
  • Allows brackets to be used in calculations

Lessons learned

This project allowed me to implement javascript basics. There was a strong focus on string manipulation to handle the numbers for display and for calculation, and adding event listeners since the calculator required human input.

There were 2 main issues which consumed alot of my time. The first one being bugs kept on popping up, and having to go back and debug code took a significant amount of time.

However, the most time consuming aspect of this project was implementing a "Shunting Yard Algorithm" to convert the original infix expression entered by a human to postfix expression for computer calculation.

The first challenge was that I had to figure out what a shunting yard algorithm was. This was fairly straightforward, and took about a day to fully grasp the concept.

Implementing a creating it however was a much more difficult task, and took me about a week.

In doing so however, I learnt a great deal about string to number conversion, and vice versa, as well as implementing objects and arrays for data storage and usage.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published