|
course.wilkes.edu/CS125Labs |
||||||
Hands On C++: Project 4
Objectives
1. Practice solving problems that involve
Introduction
Each of the following projects involves the use of character
strings, and can be solved using the
Projects
4.1.
As written, our
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:
Don't forget to remove your binaries when you are all finished...
|
Home Membership
|
|||||
|
Last update: Wednesday, August 23, 2000 at 11:25:16 AM. |
||||||