Question: C++ help program something like this? Write a program to determine if the user's input is a palindrome or not Recall that a palindrome is

C++ help program something like this?

Write a program to determine if the user's input is a palindrome or not Recall that a palindrome is a word which is the same when spelled forward or backward: deed radar mom 0tto 2112 racecar (I didn't say they had to make sense...) The only trick to palindromes is remembering to ignore capitalization. The book's solution is nifty, but doesn't occur until Chapter 10. (I'll be that's a bit out of our league..! Although reading the first page or two couldn't hurt us to get ideas...) In another text (or was it on the InterWebs..?) we find them creating the reverse of the string and comparing this to the original. It may seem clever at first, but it isn't a good approach. Neither is the common part of the solution to make the string all lower-case before comparing. (Nor is removing all the punctuation/spacing by duplicating what isn't into a copy of the string when doing phrase-style palindromes...not that that would concern us. "shrug") All of these suffer from two problems: duplicate storage of essentially the same information when we aren't going to ever need it again and processing the user's string multiple times to decide if it is a palindrome or not. (Some suffer that last problem in spades!) You'll need to remove all these inefficiencies in your solution. You should only have to make one pass through the string to determine its palindromicity (is that even a word?? "shrug"). Ideally, your code for determining palindrom-ness would be encapsulated within a function - making the main little more than a nice driver. However, I suppose that could be an option. "sigh

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!