Question: Hello, this is for programming in C++ . Please please please please FOLLOW the assignment below. I have several errors and I just dont know
Objective Students will gain familiarity with using a user-created Stack class, exception handling, parsing algorithms, and working with postfix expressions. Assignment Summary Implement a simple stack-based calculator. It should work like dc. In Linur, dc is a reverse-polish (postfix) desk calculator. It reads from the standard input and sends output to the screen You are writing a client program whicl operations have already been implemented for you in stack.cpp. Exception handling should be provided for stack underflow, overflow, and any invalid operator which is entered by user h makes use of the stack operations in stack.h. These Name your client file dc.cpp and store it in a Prog2 directory of your class directory on your class account Calculator Operations Our version of dc will support integer arithmetic. To enter a negative number, begin with an u derscore (). The character cannot be used for this, as it is a binary operator for subtraction instead. To enter two numbers in succession, separate them with spaces or newlines. White space has no meaning as a command Your calculator should support the following operations p Prints the value on the top of the stack, without altering the stack. A newline is printed after the value n Prints the value on the top of the stack, pops it off, and does not print a newline after f Prints the entire contents of the stack without altering anything.A newline is printed after each value . c-Clears the stack, renderig t empty d Duplicates the value on the top of the stack, pushing another copy of i. Thus "4d*p" computes 4 squared and prints it r Reverses the order of (swaps) the top two values on the stack Pops two values off the stack, adds them, and pushes the result Pops two values, subtracts the first one popped from the second one popped, and pushes the result Pops two values, multiplies them, and pushes the result ./-Pops two values, divides the second one popped from the first one popped, and pushes the result % Pops two values, computes the remainder of the division that the / command would do. and pushes that Sample Run If the input is 2 3+ 4 6 P 4%p 2 100 3 4 5 f 5d*p rf2pc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
