CS49J

Remember not to create packages. Use the default package

A

Write a simplified application to illustrate the use of an undo button for a word processor. It keeps a history of all items and allows the user to undo the last.

Write a class UndoStack.

Implement using a Stack of Strings. The constructor will create an empty Stack to keep the history.

A UndoStack has these methods:

 

Codecheck URL

B

In this problem you will do a better implementation of the to do list. Write a class ToDoList that maintains a priority queue to manage the items to be done.

Write a class ToDoItem. ToDoItem has a description and a priority. The constructor takes these as parameters in that order.

ToDoItem implements Comparable interface and has these methods

Write the class ToDoList. Its constructor initializes an empty PriorityQueue.

ToDoList has these methods

Codecheck URL