Question: PLEASE REDO CODE ! I POSTED TWICE AND THEY DONT WORK PROPERLY AND IT WAS MISSING STACK.H Thanks in advance for your help! create your

PLEASE REDO CODE ! I POSTED TWICE AND THEY DONT WORK PROPERLY AND IT WAS MISSING STACK.H

Thanks in advance for your help!

create your own stack class that is implementd as a linked list.

Use that to create a posstfix calculator.

Please include only source files as Stack.h and Postfixcalc.cpp

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

PLEASE REDO CODE ! I POSTED TWICE AND THEY DONT WORK PROPERLY

ex.

infix postfix

10 / 2 = 10 2 / =

1 + 5 = 1 5 + =

10 / (1 + 4 - 6) = 10 1 4 + 6 -/ =

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Algorithm for the postfix calc

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

AND IT WAS MISSING STACK.H Thanks in advance for your help! create

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

example of calculator

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

your own stack class that is implementd as a linked list. Use

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

stack requirements

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

that to create a posstfix calculator. Please include only source files as

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In this lab you are going to create a postfix calculator using a stack. Postfix notation is parenthesis-free as long as operator arities are fixed. In postfix notation, the operators follow their operands. For instance, to add 3 and 4, one would write '3 4+" rather than "3 +4". If there are multiple operations, the operator is given immediately after its second operand. For example, the expression written "3 - 4 +5" in conventional notation would be written "3 4 - 5+" in postfix notation. The postfix notation is stating to first subtract 4 from 3 and then add 5 to that. An advantage of postfix is that it eliminates the need for parentheses that are required by infix (standard) notation. While "3 - 4* 5" can also be written "3 - (4 * 5)", that means something quite different from "(3 - 4) * 5". In postfix, the former could be written "3 4 5 * -", which unambiguously means "3 (4 5 *) " which reduces to "3 20 -"; the latter could be written "3 4 - 5 *" (or 5 3 4 - *, if you wish to keep similar formatting), which unambiguously means "(3 4 -) 5 *". read in a string equation while the string is not "stop" if the string is + pop the last 2 values from the stack push back their sum else if the string is * pop the last 2 values from the stack and push back their product else if the string is - pop the last 2 values from the stack and push back the difference (second value - first value) else if the string is / pop the last 2 values from the stack push back the quotient (second value / first value) else if string is = print the top of the stack pop the stack else if the string is a number convert to a double and push it on the stack; read the next string equation Type in a postFix expression or stop to quit: 13 + = 4.00000 10 5 / = 2.00000 10 6 2 + 3 - 7 = 2.00000 1.1 2.2 * 2.42000 stop Note: You must show five digits after the decimal and the calculation should be accurate to that precision. You need to create a stack class in a file called Stack.h. The stack class is a template class. The stack class should further be an implementation of the Stack ADT as a linked list. You must write a constructor, destructor, peek, pop, push, and isEmpty method. You will then create a single object of this class in order assist with carrying out the post-fix calculator algorithm shown above. Note: You may not use the STL Stack or List implementation. Further you may only use the string, iomanip, and iostream includes. Use of any other library or implementation will result in 0 pts. Hints To convert a string word into a double use: o stod(word) For nice output include o in the output with cout you will want to use the following options: fixed showpoint setprecision(SomeNumber)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!