Question: C++ Programming Exercise Assignment 7.2 [20 points] Do programming problem 6 from chapter 6 of the text. Use the pseudocode algorithm that evaluates postfix expressions
C++ Programming Exercise
![C++ Programming Exercise Assignment 7.2 [20 points] Do programming problem 6 from](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66e3d774503e5_85966e3d773e788f.jpg)

Assignment 7.2 [20 points] Do programming problem 6 from chapter 6 of the text. Use the pseudocode algorithm that evaluates postfix expressions given at the end of section 6.3.1 and the pseudocode algorithm that converts an infix expression to postfix form given near the end of section 6.3.2. Use the STL stack class. The problem says to "Design and implement a class of infix calculators," but it seems to me that it makes more sense to simply write a function named "evaluateInfix" that evaluates infix expressions. It should have one string parameter and should return an int result. It should call a separate function named "infixToPostfix" to convert the infix expression into a postfix expression, and then it should do the work of evaluating the resulting postfix expression. Then write a main() function to thoroughly test the function. Consider simple infix expressions that consist of single-digit operands; the operators +, -, *, and/; and paren- theses. Assume that unary operators are illegal and that the expression contains no embedded spaces. Design and implement a class of infix calculators. Use the algorithms given in this chapter to evaluate infix expressions as entered into the calculator. You must first convert the infix expression to postfix form and then evaluate the resulting postfix expression. Assignment 7.2 [20 points] Do programming problem 6 from chapter 6 of the text. Use the pseudocode algorithm that evaluates postfix expressions given at the end of section 6.3.1 and the pseudocode algorithm that converts an infix expression to postfix form given near the end of section 6.3.2. Use the STL stack class. The problem says to "Design and implement a class of infix calculators," but it seems to me that it makes more sense to simply write a function named "evaluateInfix" that evaluates infix expressions. It should have one string parameter and should return an int result. It should call a separate function named "infixToPostfix" to convert the infix expression into a postfix expression, and then it should do the work of evaluating the resulting postfix expression. Then write a main() function to thoroughly test the function. Consider simple infix expressions that consist of single-digit operands; the operators +, -, *, and/; and paren- theses. Assume that unary operators are illegal and that the expression contains no embedded spaces. Design and implement a class of infix calculators. Use the algorithms given in this chapter to evaluate infix expressions as entered into the calculator. You must first convert the infix expression to postfix form and then evaluate the resulting postfix expression
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
