Have the function LetterChanges(str) take the str parameter being passed and modify it using the following algorithm. Replace every letter in the string with the letter following it in the alphabet (ie. c becomes d, z becomes a).
Then capitalize every vowel in this new string (a, e, i, o, u) and finally return this modified string.
letter Changes coderbyte java
Letter Changes I coderbyte python
Using the Python language, have the function LetterChanges(str) take the str parameter being passed and modify it using the following algorithm. Replace every letter in the string with the letter following it in the alphabet (ie. c becomes d, z becomes a). Then capitalize every vowel in this new string (a, e, i, o, u) and finally return this modified string.
Letter Changes I coderbyte JavaScript
Using the JavaScript language, have the function LetterChanges(str) take the str parameter being passed and modify it using the following algorithm. Replace every letter in the string with the letter following it in the alphabet (ie. c becomes d, z becomes a). Then capitalize every vowel in this new string (a, e, i, o, u) and finally return this modified string.
Explanation
You have to realize that the string passed in may contain items other than letters of the alphabet. If you find a character that is not a-z then just pass it along to the newStr as is without any modification. I am going to compare each letter in the string to the alphabet string. If the letter is found then I am going to return the next letter in the string unless the letter is z and them I am going to return a. When finished I am going to use a RegExp to replace all lower case vowels with upper case.
Disclaimer: The above Problem is generated by Coderbyte but the Solution is provided by ShouterFolk.