Question: 4 . 2 6 LAB: Grocery list editor with undo stack In this lab a grocery list editor with undo functionality is implemented. Step 1

4.26 LAB: Grocery list editor with undo stack
In this lab a grocery list editor with undo functionality is implemented.
Step 1: Inspect the UndoCommand abstract base class
The read-only UndoCommand. py file has a declaration for the UndoCommand abstract base class. Ac on the orange arrow next to
main.py at the top of the coding window. The UndoCommand class repres that stores all needed information to execute an action at a later point in time. For this lab, a command grocery list change made by the user.
Step 2: Inspect the incomplete GroceryList class
The GroceryList class is declared in
GroceryList.py. Two attributes are declared:
A list of strings for list items
A stack of UndoCommand references for undo commands
A simple list implementation of stack ADT is provided in
Stack.py.
Note that the add_with_undo() method is already implemented. The method adds a new item to the list a RemoveLastCommand object onto the undo stack.
 4.26 LAB: Grocery list editor with undo stack In this lab

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!