This Simple Calculator Program which converts infix expressions to postfix and then evaluates the postfix expression using a stack.
This C++ program provides functions to convert an infix expression to a postfix expression and evaluate it. It uses a custom stack implementation (Stackt
) to perform the conversions and calculations.
- C++ compiler
- Standard C++ libraries
- Compile the program using a C++ compiler (e.g.,
g++
). - Run the compiled executable.
- Enter an infix expression when prompted.
- The program will output the corresponding postfix expression and the result of the evaluation.
main.cpp
: Contains the main program logic for reading user input, converting infix to postfix, and evaluating the postfix expression.Stackt.h
: Header file for theStackt
template class, which provides stack operations.Stackt.cpp
: Implementation file for theStackt
template class.