Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. To-Do List Design Outline
  2.  
  3. Your To-Do List application should consist of following eight classes and a main file that implement all of the functionality in the specification document. Note that this is a minimal description of the code design; it is entirely possible (and likely!) that you will have to expose more functionality or create helper functions beyond what is described below. In summary, the following design is expected in your implementation, but it is not a complete overview.
  4.  
  5. Task
  6.  
  7. Task is a generic data container class that wraps information related to all tasks—a deadline and a description. It must be able to provide details about itself and it must encapsulate as much functionality as it can as a superclass (see below).
  8.  
  9. ShoppingTask
  10.  
  11. ShoppingTask is a subclass of Task. It introduces a data member necessary for recording items to purchase. It may override some superclass functionality or provide specialized information that leverages polymorphism.
  12.  
  13. EventTask
  14.  
  15. EventTask is a subclass of Task. It introduces more data members necessary for knowing the event location and time. It may override some superclass functionality or provide specialized information that leverages polymorphism.
  16.  
  17. HomeworkTask
  18.  
  19. HomeworkTask is a subclass of Task. It introduces a data member necessary for acknowledging the relevant course subject. It may override some superclass functionality or provide specialized information that leverages polymorphism.
  20.  
  21. TaskList
  22.  
  23. TaskList provides an interface over a data structure that stores many tasks. It provides functionality such as getting a specific task from the list, adding a new task to the list, removing a specific task from the list, and outputting all of the tasks in the list. Consumers of TaskList may need more information about the contained tasks, so feel free to expose more functionality, without breaking encapsulation.
  24.  
  25. ToDoListDriver
  26.  
  27. ToDoListDriver provides an interface over two TaskLists—one that represents the outstanding tasks and another that represents the completed tasks. It provides functionality such as creating a new outstanding task, removing a specific outstanding task, marking a specific outstanding task as complete, and outputting the outstanding/completed tasks in non-detailed/detailed manners. Consumers of ToDoListDriver may need more information about the outstanding and completed task lists, so feel free to expose more functionality, without breaking encapsulation.
  28.  
  29. Command
  30.  
  31. Command is a data container struct/class that tracks a single (reversible) command invoked by the user—i.e., ADD, COMPLETE, and REMOVE. It is meant to aid in the process of undoing and redoing actions. Command contains a command type and the specific task affected by the invoked command.
  32.  
  33. ToDoListApp
  34.  
  35. ToDoListApp is the main entry point into your application. It exposes one public function, run(), that executes the main program loop ad infinitum. It serves as the main interaction point with the user, ideally controlling all input and output in the program. ToDoListApp contains an instance of ToDoListDriver that gets manipulated based on the user's input commands. This class keeps track of commands in order to accomplish undo and redo actions. In terms of sheer lines of code, this will probably be the biggest class to implement. ToDoListApp will need many helper functions; if you write absolutely all the code inside of run(), the code will be very difficult to understand.
  36.  
  37. main.cpp
  38.  
  39. Your main function is very simple; it creates an instance of ToDoListApp and runs it.
  40.  
  41. Final Notes
  42.  
  43. Some important details have been omitted. For example, I do not mention any specific data structures. I do not specify how exactly undoing and redoing works. I do not specify where saving and loading should take place. Feel free to discuss these open questions with your fellow classmates.
  44.  
  45. There are some interesting things you can do to make your code more powerful and modular. For example, you can implement and expose class-specific enums that describe well-defined, class-related states. Doing so allows you to provide enum values to functions (from external callers) for custom behavior. Research how this is done. Moreover, you can look into how to use ostream and/or how to pass ostream references into functions, so as to generalize the "stream" that your code outputs to (cout is not the only possible stream!). Start researching and leveraging the power of C++. If you're not sure whether you are allowed to use a specific C++ capability or STL module, you should ask me about it.
  46.  
  47. Be sure to read the specification carefully. As you code, let me know if you run into any issues with the solution executable. Remember that your output must conform to the solution's output. Your grade partly depends on it! Good luck!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement