You will implement a calculator using stacks and queues


You will implement a calculator using stacks and queues. Your calculator must support the following operators:

* Addition

* Subtraction

* Multiplication

* Division

* Modulo

* Parenthesis

The input will be given in the form of infix expressions, e.g. ( 2 + 3 ) * 5. Implement parenthesis checking to ensure that the input is a valid expression. If the expression is not valid, output an error message. Convert the checked infix expression it into a postfix expression ( e.g. 2 3 + 5 * ). Use a stack for the infix to postfix conversion. Store the resulting postfix expression in a queue and print it onto the screen. Then, using a second stack, evaluate the postfix expression and print the result.

Include a README file describing how to run your program and give an example.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: You will implement a calculator using stacks and queues
Reference No:- TGS01246188

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)