I am currently working on a project where I must translate a paragraph of english, into a different alphabet (basically our normal alphabet, but all letters are shifted down 15 spaces.)
For example, 'A' would be 'P', 'B' is 'Q', 'C' is 'R'...and so forth.
From what I've learned so far this semester, I believe I can use a giant switch statment to use after get char to "translate", but would that be the easiest way?
I figure, there would be a pattern of adding 15 to the ASCII value to get the new, translated letter, but what happens when yuo get 'Z'? You couldn't add 15 do it, or it would give you a lowercase 'i'.
Speaking of lowercase, if the original text has lowercase, than the translated letter must also be lowercase. Same for upper. (This I know I can just use isupper and islower, but just wanted to make sure that won't interfere with the rest of the code to translate).
So what's the smartest and easiest way to translate this?
Thanks in advance for your help.