Question: C++ Programming: Subject: Stacks Need: header file, cpp file and main file Please explain your code (with comments) so I can follow/understand along and specify
C++ Programming:
Subject: Stacks
Need: header file, cpp file and main file
Please explain your code (with comments) so I can follow/understand along and specify which is the header and cpp files. I will rate when program functions correctly thanks.

Here is the example from the book it says to refer to:


Carefully review Program 19-2 in your textbook, MathStack. This is a staticstack meaning that the size of the stack is set at the beginning of the program (see line 11): MathStack stack(5) I would like you to modify this program as follows 1. Implement it as a dynamic stack (do not use a static stack as it is designed in the book). Use a linked list to implement this. There's code in the book 2. Add functionality for Mult, Div, Pop, and Display. 3. Create a looping menu-driven program to demonstrate your code so that the user has the choice of 1. Push (an integer onto the stack) 2. Pop (an integer off the stack) 3. Add (the top two values in the stack and replace those two values with the sum) 4. Subtract (the top two values on the stack and replace those two values with the difference) 5. Mult (same as above) 6. DIV (same as above but check for div by 0) 7. Display Stack 8. End Make sure you have validation in the mutators. Watch out for division by o and not having enough integers on your stack to do the operation. Make sure to only allow integers on your stack. Finally, make sure main0 is properly organized into functions and don't forget to document your code including your class. Please submit to us: 1. .cpp and .h files 2. 2 jings, one to show the code operating correctly and one to show error handling
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
