I have been tasked with coming up with a way of encoding a string. Among other things, I need to shift each letter by a given number but the transformed letter must be a let
Where your code goes wrong is when the shifted letter has a smaller character code than its original was, yet your code always adds a positive value to do the shift. You first need to detect when you are in this situation (for example, if the shifted letter is greater than z), and then make the appropriate fix (hint: consider the difference between the character code you want and the one you are getting now).