This assignment, once again, is to implement an interactive version of the KWIC index system (described in Parnas's On the Criteria To Be Used in Decomposing Systems into Modules) in the implicit invocation paradigm. You will be provided with a partial C++ implementation of the system and asked to identify and make the necessary modifications.
The provided system, as in Assignment 2, is simply a line alphabetizer. It interactively inputs a line at a time and upon demand outputs an alphabetized list of the current collection of lines. Unlike the first assignment this version also allows a delete command. Here is a transcript of a sample session:
Add, Delete, Print, Quit: a > Star Wars Add, Delete, Print, Quit: a > The Empire Strikes Back Add, Delete, Print, Quit: a > Return of the Jedi Add, Delete, Print, Quit: p Return of the Jedi Star Wars The Empire Strikes Back Add, Delete, Print, Quit: d > Star Wars Add, Delete, Print, Quit: p Return of the Jedi The Empire Strikes Back
Your assignment is to modify the existing code to support the following changes:
Here is a sample session of the new system:
Add, Delete, Histogram, Print, Quit: a > Star Wars Add, Delete, Histogram, Print, Quit: a > The Empire Strikes Back Add, Delete, Histogram, Print, Quit: a > Return Of The Jedi Add, Delete, Histogram, Print, Quit: p -- Number of Original Lines: 3-- Back The Empire Strikes Empire Strikes Back The Jedi Return Of The Of The Jedi Return Return Of The Jedi Star Wars Strikes Back The Empire Wars Star Add, Delete, Histogram, Print, Quit: d > Star Wars Add, Delete, Histogram, Print, Quit: p -- Number of Original Lines: 2-- Back The Empire Strikes Empire Strikes Back The Jedi Return Of The Of The Jedi Return Return Of The Jedi Strikes Back The Empire