Your instructor will assign you one of the problems below. To solve your problem, write a program that reads the necessary information to compute and output the indicated values, as efficiently as possible. Following the pattern in the lab exercise, first, design using OCD; then code your design in C++ using stepwise translation; finally, test your program thoroughly.
Project #5.1: As written, ourPiglatin()
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 byPiglatin()
so that it will correctly translate words like yes, yellow, quiet, quack, and squire without losing the ability to correctly translate words like style, rhythm, luck, and blue.
Project #5.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.
Project #5.3: A (very) simple encryption method is to reverse the order of the characters in a word, so that if the characters in the messageOEMOR 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.
Project #5.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"androt13("EBZRB") == "ROMEO"Write aRot13()
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 the following things: