Hello! Thanks for clicking on this post. I could use a fresh pair of eyes.
I was tasked with creating a program that encrypts a line of text (for example, CANDY) by shifting the letters X amount of times. For example, if the user inputs the sentence CANDY and selects a shift of 5, the output would be:
HFSID
I got this part working fine. The issue I am having is with the decryption part of the program. This is simply the reverse of the above, as the user would enter the phrase HFSID, with a shift of 5, and the program would output:
CANDY
It works fine, all except for one letter, being the "F" letter. With my code, when I enter the above
word to be decrypted it outputs:
C[NDY
Obviously, that [ bracket is not an 'A'. I realise the issue falls with the equation, but upon messing around with the program for about four hours, it is all starting to blur together. I just need a point in the right direction...
Here is my code:
Any help is appreciated!