In this part of the assignment, you will code a ciphering program. A cipher is an algorithm for performing encryption or decryption of messages. We will use a cipher algorithm that I have devised called step cipher.
Task # 1: Write a method called encode that will encode a message using a specified key that is in the range 0 through 25. The header of the method should be as follows:
public static String encode(String message, int key)
The message may include spaces and punctuation characters, but only the lower case characters 'a' through z should be encoded.
Each of the letters of the alphabet will map to the letter key positions further along in the alphabet. For example, if the key value is 4, the letters of the alphabet will be mapped as follows:
A -> E
B -> F
C -> G
and so on...
Task # 2: Write a function that will decode a message using a specified key that is in the range 0 through 25. The header of the method should be as follows:
public static String decode(String codedText, int key)
The coded text may include spaces and punctuation characters, but only the lower case characters 'a' through z should be decoded.
You may not use StringBuilder to solve this problem.
All code needs to be sufficiently commented.