https://github.com/basemax/mathematicalexpressionevaluator
This is a C++ program that evaluates mathematical expressions containing operators +, -, *, and /, and parentheses ( and ). The program supports multi-digit numbers and guarantees that parentheses are used for each operator.
https://github.com/basemax/mathematicalexpressionevaluator
calculator calculator-app calculator-application calculator-cpp cpp cpp-calculator expression-calculate expression-checker expression-evaluator expression-language expression-parser expression-tree expressions mathematical
Last synced: 6 months ago
JSON representation
This is a C++ program that evaluates mathematical expressions containing operators +, -, *, and /, and parentheses ( and ). The program supports multi-digit numbers and guarantees that parentheses are used for each operator.
- Host: GitHub
- URL: https://github.com/basemax/mathematicalexpressionevaluator
- Owner: BaseMax
- License: gpl-3.0
- Created: 2023-06-24T22:22:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-24T22:31:39.000Z (over 2 years ago)
- Last Synced: 2025-03-28T17:08:07.281Z (6 months ago)
- Topics: calculator, calculator-app, calculator-application, calculator-cpp, cpp, cpp-calculator, expression-calculate, expression-checker, expression-evaluator, expression-language, expression-parser, expression-tree, expressions, mathematical
- Language: C++
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mathematical Expression Evaluator
This is a C++ program that evaluates mathematical expressions containing operators `+`, `-`, `*`, and `/`, and parentheses `(` and `)`. The program supports multi-digit numbers and guarantees that parentheses are used for each operator.
## Usage
Clone the repository or download the source code files:
```shell
git clone https://github.com/BaseMax/MathematicalExpressionEvaluator
```Compile the source code using a C++ compiler:
```shell
g++ main.cpp -o math_expression_evaluator
```Run the program:
```shell
./math_expression_evaluator
```Enter a mathematical expression without spaces and press Enter. The program will evaluate the expression and display the result.
## Examples
**Expression:** (5+((8+2)*2))
**Result:** 25
---------------
**Expression:** ((6*(2+1))*(3+(3+1)))
**Result:** 126
## License
This project is licensed under the GPL-3.0 License.
Copyright 2023, Max Base