Answer:
See below
Explanation:
This question is usually in response to having just learned arrays and string/character processing. Also, encrypted text is all caps, decrypted text is all lowercase. Convert the string accordingly with the uppercase/lowercase functions for your particular language.
Then, follow the following algorithm:
Loop through each character of the string. Add (or subtract if decrypting) the character. If it goes beyond the last letter of the alphabet, then subtract the shift from 26 (which is the number of letters in the alphabet. Add the character to a new string, and return it.