Question: Q : (c++ only) A recursive function is a function that calls itself until some type of exit criteria is reached. There is more information

Q : (c++ only) A recursive function is a function that calls itself until some type of exit criteria is reached. There is more information on recursive functions in Chapter 20, as well as all over the Internet.

Write a simple program that will use a recursive function to check whether or not an input string (in the form of a C-string character array) is a palindrome.

Your program must convert the input string into a modified string that is just alphabetic characters, upper case; lower case letters are converted to upper case, and any spaces and punctuation are ignored. For example, if the input string is "Hello there, You" the modified string would be "HELLOTHEREYOU". Perform your palindrome check on that modified string.

Your program must:

Use a c-string character array for your operations. Do not perform the palindrome check on a simple string.

Use a function to "clean up" the input c-string to the modified c-string by removing non-alphabetic characters and converting lower case letters to upper case. You'll need to do this by copying "valid" c-string elements into a second array.

Accept either a word or a sentence (up to 80 characters) as input

Your output must be formatted exactly as shown below:

Enter your word or sentence up to 80 characters: (anything past 80 is ignored: A nut for A Jar of tUNA You entered: A nut for A Jar of tUNA Conversion to an all caps, all alpha string is: ANUTFORAJAROFTUNA which is a palindrome. 

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!