Create an interface MessageDecoder that has a single abstract method decode( cipherText), where cipherText is the message to be decoded. The method will return the decoded message. Modify the classes SubstitutionCipher and ShuffleCipher, as described in Exercises 16 and 17, so that they implement MessageDecoder as well as the interface MessageEncoder that Exercise 15 describes. Finally, write a program that allows a user to encode and decode messages entered on the keyboard.
This project demonstrates creating multiple concrete classes that implement two related interfaces. The most difficult part of this implementation is handling characters in the substitution cipher.
See the code in MessageDecoder.java, ShuffleCipher.java, SubstitutionCipher.java, and CodeProgram.java.
You might also like to view...
Select the incorrect statement. Binary search trees (regardless of the order in which the values are inserted into the tree):
a. Always have multiple links per node. b. Can be sorted efficiently. c. Always have the same shape for a particular set of data. d. Are nonlinear data structures.
How many bytes of memory are used in MS Visual C++ for the datatype double ?
A. 1 B. 4 C. 8 D. 2
Computers in a peer-to-peer network belong to a ________
a.client-server group b.domain c.personal area network d.workgroup
In mail merge, a placeholder that represents specific information in a data source is a merge:
A) entry. B) field. C) source. D) record.