This is a simple calculator application built using the Crow C++ microframework. It provides a web API for performing basic arithmetic operations such as addition, subtraction, multiplication, and division.
To use the calculator app, follow these steps:
- Clone the repository or download the source code.
- Build the application using a C++ compiler.
- Run the compiled executable to start the calculator server.
The calculator app exposes four API endpoints for different arithmetic operations:
- /add/value1/value2: Performs addition of value1 and value2.
- /subtract/value1/value2: Performs subtraction value2 from value1
- /multiply/value1/value2: Performs multiplication of value1 and value2
- /divide/value1/value2: Performs division of value1 by value2
Replace value1 and value2 in the URL path with the desired numeric values.
Example usage:
- To add two numbers, use the following URL: http://localhost:8080/add/3.5/2.1
- To subtract two numbers, use the following URL: http://localhost:8080/subtract/5.9/1.2
- To multiply two numbers, use the following URL: http://localhost:8080/multiply/2.5/4.2
- To divide two numbers, use the following URL: http://localhost:8080/divide/10/2
The calculator app handles division by zero errors. If the divisor (value2) is zero in the /divide endpoint, a DIVIDE BY 0 Error! message will be thrown.
The calculator app relies on the following dependencies:
- Crow C++ microframework
Make sure to install the necessary dependencies before building and running the application
Feel free to customize and enhance this README file to suit your specific needs.