Question: the problem is suppose to be done with main.py and a stack.py any help is appreciated Stacks in Python A stack is a linear data

Stacks in Python A stack is a linear data structure that stores items in a Last-In/First-Out (LIFO) or First-In/Last-Out (FILO) manner. In stack, a new element is added at one end and an element is removed from that end only. The insert and delete operations are often called push and pop. I Puch Last in, first out Stack Insertion and Deletion happen on same end pop The functions associated with stack are: empty() - Returns whether the stack is empty size()-Returns the size of the stack topo) - Returns a reference to the top most element of the stack append(g) - Adds the element 'g' at the top of the stack pop() - Deletes the top most element of the stack ASSIGNMENT ( 6 points Minor Summative) I Use the above functions to Create a class "Stack" and create constructors, member functions to: 1. Set the default max elements in stack as 3 in constructor, the user can pass any positive number to the constructor to specify the stack size 2. Push maximum number of items in stack. (Name of member function - pushStack) 3. Return the size of the stack (Name of member function - sizeStack) 3. Print the stack. (Name of member function - printStack). Print only the top element of the stack (Name of member function - peek Top) 5. Keep popping and printing items till the stack is empty. Member functions - popStack, isEmpty. 6. Documentation - write comments in the code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
