(continuing Q2) Then we'd also want to have a redo() method. Implement this!
Anonymous
I used another stack. If an undo() is called, pop that from undo stack, create a new object which holds undo's method and current value, and push that into redo stack. And then revert the rectangle's value into what was in undo's stack. Remember to clear out redo stack after you undo something and call a new method!
Check out your Company Bowl for anonymous work chats.