4.1. As written, our Piglatin() function fails to correctly translate words such as yes (esyay) and yellow (ellowyay) in which the first vowel 'y' is actually being used as a consonant. It also fails to correct translate words such as quiet (ietquay) and quack (ackquay), in which the first vowel is a 'u' following a 'q'. Redesign the algorithm used by Piglatin() so that it will correctly translate words like yes, yellow, quiet, and quack, without losing the ability to correctly translate words like style, rhythm, luck, and blue.
4.2. A character string is said to be a palindrome if it reads the same when the order of its characters is reversed. For example, the following are all palindromes:
madam smada bob adams able was I ere I saw elbaWrite a function that, given a character string, returns true if that string is a palindrome, and returns false otherwise.
4.3. A (very) simple encryption method is to reverse the order of the characters in a word, so that if the characters in the message
OEMOR OEMOR EROFEREHW TRA UOHTare reversed word-by-word, then the decoded message reads:
ROMEO ROMEO WHEREFORE ART THOUWrite a function that, given a character string, returns the reverse of that character string.
4.4. Internet mailers and news-readers often contain a "rot13" function that can be used to "encrypt" words by rotating their characters 13 positions (i.e., A becomes N, B becomes O, C becomes P, ... Z becomes M). This is convenient, because the same function can be used to both "encrypt" and "decrypt" a word:
rot13("ROMEO") == "EBZRB"
and
rot13("EBZRB") == "ROMEO"
Write a Rot13() function that, given a string,
returns a string whose characters are those of the first string
rotated 13 positions.
(Hint: You may find the % operator to be useful.)
Turn In: A hard copy of this grade sheet, attached to hard copies of
Don't forget to remove your binaries when you are all finished...