A palindrome is a word or phrase that can be read forward or backward.
The file palindrome.cc contains the outline for a program
that reads in a line of text from the user, passes the text as a primitive
string to the undefined method Palindrome
, that returns a boolean for whether
the specified string is a palindrome. The Palindrome
method should
ignore all non-alphabetic characters and should not be case sensitive.
For example, the following text should be recognized as a palindrome by
your program:
Never odd or even!
In order to determine if a character is alphabetic, uppercase, or
lowercase, take advantage of how ascii characters are represented. The
characters a - z
when cast to integers are 97 - 122
and the characters
A - Z
when cast to integers are 65 - 90
. Do not use the functions in
cctype. Be sure to test your code on multiple examples and on the cs server.
Tar your code in a file that contains your name and submit it on the course Inquire site.