Skip to content

grj373/evolve-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Evolve Calculator

Evolve Calculator is a simple JavaScript-based calculator that performs basic arithmetic operations such as addition and subtraction.

Project Structure

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).

Features

  • Add two numbers.
  • Subtract two numbers.

Usage

  1. Set the first number using the setNumber(number) function.
  2. Set the operation using the setCalculation(c) function, where c can be "+" for addition or "-" for subtraction.
  3. Set the second number using the setNumber(number) function.
  4. Call the calculate() function to perform the operation and get the result.

Example

setNumber(5); // Set the first number
setCalculation("+"); // Set the operation to addition
setNumber(3); // Set the second number
console.log(calculate()); // Outputs: 8

Future Enhancements

  • Implement a user interface in index.html.
  • Add support for more operations such as multiplication and division.
  • Improve error handling and input validation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published