A simple calculator that can use multiple types of operations and accepts infinite values (or until the program runs out of memory)
- Install Node.js here // Both should work!
- Open your chosen command prompt
- Change directory to SimpleCalculator
- Run npm run calculate (or npm run c)
- Answer the questions the command line gives you.
- If you want to access options go to simplecalculator/src/options.js and change the options to true or false.
- If the calculation is taking too long press ctrl + c to stop the program. Most likely you caused an infite loop. Make sure your operation inputed is supported and it's all lowercase.
This project is a simple calculator that has multiple types of operation such as:
- Addition
- Subtraction
- Multiplication
- Division
- Exponential
- Remainder
- Tax | Calculates tax and returns a table [amount, taxrate]
- Square | Returns the square root of a number [numToSquare]
- Circumference | Returns the circumference of a circle [radius]
- Radius | Returns the radius of a circle [circumference]
- CircleArea | Returns the area of a circle [radius]
- squareArea | Returns the area of a square [side]
- slope | Returns the slope of a line [x1, y1, x2, y2]
- slopeIntercept | Returns the slope intercept of a line [x, y intercept, num]
- interest | Returns the interest of a loan [principal, rate] - WIP
- delete | Deletes your saved data
Any calculation you run will be stored in simpleCalculator/SRC/data/savedCalculations.txt The file will be created whenever you run the calculator the first time.
- commas | Have numbers separated by commas. [true, false]
If you want to contribute to this project, please make a pull request and I will review it.
- SaveData deleting
- Node.JS
- NPM
- Readline Sync
This project was mainly used as a learning tool and was my first real JavaScript project. I originally started building this because I was bored in school but it has evolved into my favorite learning tool. This project has taught me more than I expected. I learned a lot about all of the following.
- Loops
- Functions
- Scopes
- Arrays
- Labels
- Modules
- Objects
- Structuring
- Git
- GitHub
- Regex (Way simpler than most people make it out to be.)
This program I know has barely any real world use but it's really fun to build so I highly recommend you do something simillar. Make sure it's achievable and that you can do it on your own. I learned my fundamentals of JavaScript from CodeCademy to learn the basics.