Create a class SubstitutionCipher that implements the interface MessageEncoder, as described in the previous exercise. The constructor should have one parameter called shift. Define the method encode so that each letter is shifted by the value in shift. For example, if shift is 3, a will be replaced by d, b will be replaced by e, c will be replaced by f, and so on. Hint: You may wish to define a private method that shifts a single character.

What will be an ideal response?


See the code in SubstitutionCipher.java.

Computer Science & Information Technology

You might also like to view...

Explain why you should learn HTML if authoring tools will do the work for you. Give other examples of where you are expected to learn something when there are tools available that will do the work.

What will be an ideal response?

Computer Science & Information Technology

In which view are files and folders displayed in list form, with the additional file information displayed in columns alongside the file names?

A) List B) Details C) Large Icons D) Extra Large Icons

Computer Science & Information Technology

If you were creating a device that would work at Layer 3 of the OSI model, with which other layers must your device directly interact?

What will be an ideal response?

Computer Science & Information Technology

Will my standby RDS instance be in the same Region as my primary?

A. Only for Oracle RDS types B. Yes C. Only if configured at launch D. No

Computer Science & Information Technology