CIS 261 Data Structures

Recursive Palindrome Checker Project

Programming Exercise

The word 'PALINDROME' comes from the Greek word palindromos, which means 'running back again'. A palindrome is any word, line or even complete poem which reads the same backwards as it does forwards. Look Here for more information on Palindromes

Write a program to read lines of text from a user specified file and identify whether each line is a Palindrome. Punctuation, spaces and capitalization can be ignored.

Sample Input: (PAL.TXT)

Eve
Madam I'm Adam
Cain and Abel
A car, a man, a maraca
Dee saw a seed
Capac
Lonely Tylenol
Able was I ere I saw Elbow

Sample Output:

Palindrome Checker

Enter Filename: PAL.TXT

Palindromes:

"Eve" IS a Palindrome
"Madam I'm Adam" IS a Palindrome
"Cain and Abel" IS NOT a Palindrome
"A car, a man, a maraca" IS a Palindrome
"Dee saw a seed" IS a Palindrome
"Capac" IS a Palindrome
"Lonely Tylenol" IS a Palindrome
"Able was I ere I saw Elbow" IS NOT a Palindrome

===================================
6 Palindromes found

Thank you for using Your Name Here "Palindrome Checker"

The main objective of this project is to write a recursive function testPalindrome that returns true if the string is a palindrome and false otherwise.

 

Grading for this project will be based on the following:

20

Design & Documentation - Including a recurrence relation for test Palindrome

15

Code for "Palindrome Checker" main()
35 Code for recursive testPalindrome

30

Does It Work?