Question
C++ Calculator using a Stack. In this assignment I can't use a library and must implement my own stack. For this program, the calculator should
C++ Calculator using a Stack. In this assignment I can't use a library and must implement my own stack. For this program, the calculator should take in a string containing an infix expression while computing and printing out the result. It should be able to handle operators such as +, -, *, /, and parenthesis.
All the numberss are single digits and the result of the calculations are also single digit. So 5 + 3 is valid because it produces a single digit 8. But 5+6 isn't because it produces 11. In the same vein, 11-2 wouldn't be valid because 11 is double digit. It should taken in valid inputs and also throw an error when it encounters an invalid string.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started