Your task is as follows:

Write a class called WordCounter. 

Private data: a single data member, which will be a binary
search tree object. This object will hold objects of type
KeyPair, but only very specific KeyPairs -- KeyPairs which
hold Strings for keys and ints for information.

Once you have looked over the keypair.* files and the bstree.*
files, the above paragraph should be sufficient to allow you to:

   1) determine how to declare the member data BST,
   2) determine how to fill in its template type, and
   3) determine whether or not WordCounter is a template
	(though (3) is also blatantly obvious from main.C,
	 but try to figure it out from the above description
	 first).


Public functions:

   Constructor - not much to do, other than to handle 
	the initialization of the member BSTree. Use the
	initializer list for this -- that is, call the default
 	constructor for the BSTree object on the initializer list 
	of this function. For examples of initializing members
	on the initializer list, look at the TreeNode class
	constructors and the Tree constructor in bstree.*


   InsertWord - takes a String as a parameter. If this 
	String has been inserted before, then the information
        integer associated with it should be increased by 1.
	Otherwise, the integer "1" should be associated with
	this String. The BST handles the storage of the 
	association pairs. 

        Note that this will not be anywhere near as 
	straightforward as it looks, because the ADT of the
	BSTree and KeyPair classes limit what you can do. 
        You will have to find a way to handle the updating
  	of the information stored in a KeyPair in the BStree
	using the interface functions you are given. 

  	You can alter the tree however you like in order to
	do this. All we care about is that you implement the
	specification, not what the tree looks like. 

 	You will learn to appreciate a well-written interface 
	after being restricted somewhat in your attempts to code
	this function.  :-) 

	
   PrintFullInfo - prints all Strings stored in the tree, in
	alphabetical order, along with their associated integers.
	See test.x and test.x.std files for examples of how the
	test data gets printed out in the end.


  PrintWordInfo - takes a String parameter. If String is in 
	tree, print out String and its associated info. If it
	is not, print out String and the number 0. See the top
	of test.x.std for examples. 


  ReadFromFile - takes a char* which will serve as a file name. 
        create an ifstream similar to the way we did this
	in main.C, and read in the information from the file. 


  WriteToFile - takes a char* which will serve as a file name,
	create an ofstream object. This stands for "output stream"
	just as in main.C we used an "input stream". We can
	write to such an output stream the same way we write to 
	cout. Write out the data in this object. 

  *** note that in main.C, you read from the file you wrote. So,
	you can write whatever you want to the file, as long as
	you can parse it correctly in the read function. 


-------

The formal handout will describe file streams a bit more, but for
now the comments in main.C give you an example to start playing 
around with, and Deitel chapter 14 has way more detail than you need
for this MP. 



				Jason

   
