Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello , ineed solution in c++ and use stack ** Predefined function not allowed Palindrome Puzzle Let's try a little puzzle. A palindrome is a

Hello , ineed solution in c++ and use stack

** Predefined function not allowed

image text in transcribed

Palindrome Puzzle Let's try a little puzzle. A palindrome is a word, phrase, number or sequence of words that reads the same backwards as forwards. Punctuation and spaces between the words or lettering is allowed. Examples "Madam, I'm Adam" is palindrome "Live not on evil" is palindrome "Hi all hi" is not palindrome The purpose of this exercise is to write a method that checks if a phrase is palindrome or not Define the class with the following members as shown in the bellow UML diagram. phrase ph: string content: Stack + readPharse() : void + ispalindrome (): bool 1) readPhrase : this function prompts the user to enter a sentence and set it to the ph member. Then, push the alphabet character, after converts to lowercase of this sentence to the content member. This means you should ignore any character other than the letters. Example: If the user enters the following sentence: "Madam, I'm Adam", your stack look like: Madam, I'm Adam Ph string a d 1 m a d a content stack 2) i spalindrome: this function checks and returns if the phrase is palindrome or not. YOU CAN'T use array here. You can use any temporary stacks. 3) In the main function, create an object of type phrase and call all its functions. Note: You can use isalpha (char) function to check if the character is letter or not

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions