[Solved] Part 1 Create Interface Messageencoder Encode Plaintext Plaintext Message Encoded Method I Q37265417
Part 1: Create an interface MessageEncoder that hasencode(plainText), where plainText is the message to be encoded.The method (when Implemented) will return the encoded message.
Part 2: Create a class SubstitutionCipher that implements theinterface MessageEncoder. The constructor should have one parametercalled shift. Define the method encode so that each letter isshifted by the value in shift. For example, if shift is 3,a will be replaced by d, b will bereplaced by e, c will be replaced by f,and so on. Hint: You may wish to define a private methodthat shifts a single character.
Part 3: Create a class ShuffleCipher that implements theinterface MessageEncoder, as described in Part 1. The constructorshould have one parameter called n. Define the method encode sothat the message is shuffled n times. To perform one shuffle, splitthe message in half and then take characters from each halfalternately. For example, if the message is “abcdefghi”, the halvesare “abcde” and “fghi”. The shuffled message is “afbgchdie”.Hint: You may wish to define a private method thatperforms one shuffle.
Expert Answer
Answer to Part 1: Create an interface MessageEncoder that has encode(plainText), where plainText is the message to be encoded. The… . . .
OR

