CMSC-341                                     Data Structures                   Section 101 & 201
Fall 1998                                         Project 3

1. The Project
The purpose of this project is to provide you with experience coding binary search trees 
in C++, the notion of inheritance and introduce you to file input in C++.  In this project 
you will read and analyze text from a designated file.

2. Description
In this project you will create a 'concordance' for a piece of English text to be read from a 
text file.  A concordance is a sorted list of words that occur in the text, along with a 
frequency count (i.e. the number of times the each word appears in the text).  A 
concordance for the text, "How much wood would a woodchuck chuck, if a woodchuck 
could chuck wood" is:

a               2
chuck		2
could		1
how		1
if		1
much           	1	
wood           	2
woodchuck	2
would		1

Your program will read data from a text file that has been preprocessed to remove 
everything expect space-delimited words, which may contain apostrophes. All words 
should be converted to lower case.  The textfile to be read and analyzed is 
/afs/umbc.edu/users/d/e/dennis/pub/cs341/proj3/project3.txt. 

Your program will then display a menu to the user with the following options:
  1. Quit
  2. Print the number of distinct words in the concordance
  3. Print the number of occurrences of a particular word. If the word does not exist in the concordance, an appropriate message should be printed.
  4. Print all the words that appear more than a certain number of times, alphabetically. If no words meet that criteria, an appropriate message should be printed.
  5. Print all the words (alphabetically) in the concordance with their frequency, as described above.
Continue to ask the user for input until the user quits. 3. Specific Tasks You will create the following classes, putting their declaration in a header (.h) file and their implementation in the appropriate .C file. The code for the String class (String.h and String.C) is in the directory /afs/umbc.edu/users/d/e/dennis/pub/cs341/proj3 4. Submitting and Grading Submit your project in the usual way, using the submit program. Submit any and all files necessary to successfully compile your program, including a makefile. In addition, you must use the Unix script facility to capture output from your program which must submitted in the file project3.scr. At the Unix prompt (assume it's $) type the following: $ script $ project3 your menu displays here now, execute each menu option at least once -- be sure to select option 3 twice; one time entering a word that you know is in the concordance and one time entering a word that is NOT in the concordance. Also select option 4 multiple times, at least once entering a frequency too high for any word in the concordance. When you have executed all menu options at least once and quit, terminate the script session by issuing the command $ exit all inputs and output between the script command and exit command are captured in the file typescript. rename typescript to project3.scr and submit with your other files. This project will be graded 60% for correct execution and 40% for style, comments, object design, structure, etc. No report is required. The usual 5-point bonus for early submission and 5-point per day penalties for late submission apply. No project will be accepted more than 48 hours late. This project is due Sunday, November 15, 1998 for section 101 Tuesday, November 17, 1998 for section 201 Special Bonus Clause -- a 10 point bonus will be awarded for any project that properly implements the BST in a balanced fashion (e.g. as a Splay, AVL or Red-Black tree). DO NOT attempt to implement a balanced tree until after you have successfully implemented the basic BST. 5. Hints 6. Bigger Hint If you make the effort, you'll find that there are easier ways to do the input.