The calculator is a simple spring-boot web application designed to perform basic arithmetic operations.
- Recieves a dynamic array of calculation instructions from a client and performs them.
- Perform addition, subtraction, multiplication, and division of two numbers.
- Supports decimal numbers.
- Run the program in your terminal or command prompt.
- mvn spring-boot:run
- Send a POST request to http://localhost:8080/calculate. Send a JSON array of calculation instructions in the body of your POST
- Press Enter to execute the calculation.
- The result will be displayed on the next line.
Request:
curl --location 'http://localhost:8080/calculate' \
--header 'Content-Type: application/json' \
--data '{
"nodes": [
{
"value": 10,
"operation": "assign",
"dependencies": []
},
{
"value": 5,
"operation": "add",
"dependencies": [0]
},
{
"value": 2,
"operation": "assign",
"dependencies": []
},
{
"value": 0,
"operation": "subtract",
"dependencies": [2, 1]
},
{
"value": 3,
"operation": "multiply",
"dependencies": [3]
}
]
}'
Response:
{
"results": [
10.0,
15.0,
2.0,
-17.0,
-51.0
]
}
This is a basic calculator and does not support advanced features like trigonometric functions, exponential operations, or complex numbers.
- This project uses [insert language/framework/library name] for development.
- Code organization follows standard best practices for readability and maintainability.
If you'd like to contribute to this project, please feel free to submit pull requests. All contributions are welcome!