Evolve Calculator is a simple JavaScript-based calculator that performs basic arithmetic operations such as addition and subtraction.
The project contains the following files:
calculator.js: Contains the core logic for the calculator, including functions for setting numbers, setting the operation, and performing calculations.index.html: The HTML file to provide a user interface for the calculator (not yet implemented).
- Add two numbers.
- Subtract two numbers.
- Set the first number using the
setNumber(number)function. - Set the operation using the
setCalculation(c)function, whereccan be"+"for addition or"-"for subtraction. - Set the second number using the
setNumber(number)function. - Call the
calculate()function to perform the operation and get the result.
setNumber(5); // Set the first number
setCalculation("+"); // Set the operation to addition
setNumber(3); // Set the second number
console.log(calculate()); // Outputs: 8- Implement a user interface in
index.html. - Add support for more operations such as multiplication and division.
- Improve error handling and input validation.