altampan-calculator
v1.2.1
Published
A simple calculator implemented in JavaScript.
Downloads
4
Readme
Simple Calculator
This is a simple calculator created using JavaScript. The calculator can perform basic mathematical operations such as addition, subtraction, multiplication, and division. Additionally, it also includes additional features to calculate the square and square root of a number.
Features
- Addition
- Subtraction
- Multiplication
- Division
- Square Calculation
- Square Root Calculation
How to Use
- Make sure you have Node.js installed on your computer.
- Copy the calculator code from
calculator.js
. - Run the code using the command
node calculator.js
. - Follow the on-screen instructions to input numbers and desired mathematical operations.
Example Usage
Addition
Enter the first number: 10
Enter the second number: 5
Choose operation (+, -, *, /, ^, sqrt): +
Result: 15
Multiplication
Enter the first number: 7
Enter the second number: 8
Choose operation (+, -, *, /, ^, sqrt): *
Result: 56
Square Root Calculation
Enter the number: 25
Choose operation (+, -, *, /, ^, sqrt): sqrt
Result: 5
Notes
- Make sure to input valid numbers and supported operations.
- The calculator will not be able to process invalid mathematical operations, such as division by zero or taking the square root of a negative number.