Question: Objective: Programming with Strings A palindrome is a string of characters that reads the same forwards as backwards. For example, the following are both palindromes:

Objective: Programming with Strings

A palindrome is a string of characters that reads the same forwards as backwards. For example, the following are both palindromes:

1457887541 or madam

Write and document a C++ program that prompts the user to enter a complete sentence and stores it in a string named myString. Next, extract words from myString, and determine whether or not they are palindromes. You should write a function called isPalindrome that takes a string (or array of characters) as input and returns true if the string is a palindrome, false otherwise.

Hint: You can use the library function strtok() to extract each word from myString.

Sample input: Madam, this level of radar testing is not easy.

Sample output:

The following words are palindrome:

Madam, level, radar,

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 Programming Questions!