Project 6 - Writing Subclasses: Some Cryptography Exercises
due Monday, Oct 25, 2004 by 5 pm

Re-read pp 358-364 in Morelli. In particular, you will need to be familiar with the Cipher, Caesar, and Transpose classes which are described in this section of the book. Do the following exercises:

1. Write a modified version of the Caesar class that allows various shift values to be used. Use an instance variable to store the shift value, and add methods that a) return the shift value, and b) change the shift value. Turn in this class in file Caesar.java.

2. Design and implement a Cipher subclass SubstEnd to implement the following substitution cipher: Each letter in the alphabet is replaced with a letter from the end of the alphabet, e.g. a is replaced with z, b is replaced with y, etc. (This is essentially exercise 7.17 in Morelli). Submit the file SubstEnd.java.

3. Exercise 7.18 in Morelli. Turn in Alphabet.java.

4. Exercise 7.19 in Morelli. Call your Cipher subclass SubstAlpha and turn in SubstAlpha.java.