Problem

(Enhanced Palindrome Tester) Enhance Exercise palindromeTester function to allow strings c...

(Enhanced Palindrome Tester) Enhance Exercise palindromeTester function to allow strings containing uppercase and lowercase letters and punctuation. Before testing if the original string is a palindrome, function palindromeTester should convert the string to lowercase letters and eliminate any punctuation. For simplicity, assume the only punctuations characters can be

. , !; : ( )

You can use the copy_if algorithm and a back_inserter to make a copy of the original string, eliminate the punctuation characters and place the characters into a new string object.

Exercise

(Palindrome Tester) A palindrome is a string that is spelled the same way forward and backward. Examples of palindromes include “radar” and “able was i ere i saw elba.” Write a function palindromeTester that uses the reverse algorithm on an a copy of a string, then compares the original string and the reversed string to determine whether the original string is a palindrome. Like the Standard Library containers, string objects provide functions like begin and end to obtain iterators that point to characters in a string. Assume that the original string contains all lowercase letters and does not contain any punctuation. Use function palindromeTester in a program.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 16
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT