CSC 273-Data Structures

Dr. R. M. Siegfried

Assignment #1 - A Concordance Program

Due Friday, September 20, 2019

A concordance is a table that tells how often a word appears in a text (or where in a text it appears; but we are not using this definition).

You are going to write a program for a concordance that:

The next step in writing this program is to write the Concordance class with:

  1. the necessary constructor that initializes the number of installed words to zero (0)
  2. Installs additional words, by placing them at the end of the array, incrementing the count and then sorting them into order.:
  3. searches the array for a word, returning the index if the word is there and return -1 if it isn't
  4. Prints the lsit of words and the number of occurences in the text.
Your program should be modular, with separate classes for handling input/output and for the concordance.

To simplify the assignment, assume that a word is any collection of consecutive characters separated by white space.

Your input should be a text file (or equivalent) and your output should be a listing of the words (in alphabetical order) and the number of times that they appear in the input.

You will submit a program listing (properly commented), your sample document (at least 40 lines of text) and the print-out.

[Back to the Assignments Page]