Data Structures Project 2

Due Fri, October 20, 2000 at 5:00pm

clarification: you should read from the input files from within your program and write to the output files.

NEW: If you turn in your assignment on time, you will given the option to improve it by submitting a new one before 5pm on Sat, Oct 21.

In this project, you will construct an implementation of the entire Sequence interface using either an array or linked list (this means that you may not use java Vector or List classes). In particular, if your student number (SSN) ends in an odd digit, you must use an array, and if your student number ends in an even digit, you must use a doubly-linked list.

You will also create a MyTextEditor class, which uses your sequence to implement the SimpleTextEditor interface. Your text editor should process strings. To demonstrate your text editor you need to create a main() method that performs the following actions:

  1. Initialize the text to be the same as the file, Initial.txt, which is provided for your benefit.
  2. Print the text.
  3. Use each and every method in the SimpleTextEditor interface (except print()) to convert the initial text into the text, Middle.txt, which is also provided for your benefit.
  4. Print the text.
  5. Use as many additional methods in the SimpleTextEditor interface as needed to convert this text into the text, Final.txt, which is also provided for your benefit.
  6. Print the text.

The following files can be used by you to study or borrow:

Or get a single tar-gzipped file.

To sum up, you need to do the following:

  1. Write a class, ArraySequence or LinkedSequence, which implements the Sequence interface using either an array or linked list (depending on your SSN).
  2. Write a class, ArrayPosition or NodePosition, which implements the Position interface in a manner consistent with your ArraySequence or LinkedSequence class.
  3. Write your MyTextEditor.java class, which includes a main() method performing the required demonstration.