Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregolive/calculator
Rule 1: Don't divide by zero.
https://github.com/gregolive/calculator
Last synced: 18 days ago
JSON representation
Rule 1: Don't divide by zero.
- Host: GitHub
- URL: https://github.com/gregolive/calculator
- Owner: gregolive
- Created: 2021-09-23T00:31:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-10T13:45:38.000Z (about 3 years ago)
- Last Synced: 2024-12-11T22:07:28.245Z (18 days ago)
- Language: JavaScript
- Homepage: https://gregolive.github.io/calculator/
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Calculator
Rule 1: Don't divide by zero.
[Live demo](https://gregolive.github.io/calculator/) ๐
## Functionality
An online calculator made with Javascript.
- Chain multiple basic operations with the ร, รท, +, and โ buttons.
- Finish a calculation with the = button and continue again with the above operators.
- Clear all with the 'AC' button and delete a recent input with the 'DEL' button.
- All the above, along with numerical input, can be done via both mouse clicks and keyboard.
- Decimal output is rounded to 2 decimal points for simplicity and to aviod screen overflow.
- In progress calculations are displayed above the main output section of the screen for usability purposes.## Reflection
This project surprised me with the amount of funcitons that were required for proper functionality and it felt like everytime I fixed one issue two more appeared in the process. Some examples of problems I hadn't considered of during the pseudocode stage included:
- Removing the ability of the user to click the delete button following an = operation and begin deleteing parts of the answers.
- Reusing an answer again following = when the user wants to continue operating on the output.
- Repeating operations when the = button is repeatedly pressed but not when the operator buttons are repeatedly pressed.The final Javascript definitely could be optimized further and some of the functionality was implemented using what may not be best practices (i.e. counter used to handle consecutive operator buttons) and could be fine tuned later with additional practice in the language.
-Greg Olive