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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started