Skip to content

dvernon5/Calculator-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Calculator-API

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.

Getting Started

To use the calculator app, follow these steps:

  1. Clone the repository or download the source code.
  2. Build the application using a C++ compiler.
  3. Run the compiled executable to start the calculator server.

Usage

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:

Error Handling

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.

Dependencies

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages