Question
C++ Palindrome Using a stack and a queue, determine whether a string is a palindrome. Create a new text file called palindrome.txt and save it
C++ Palindrome
Using a stack and a queue, determine whether a string is a palindrome.
Create a new text file called palindrome.txt and save it in the same directory with your other files, or in the same project.
Copy and paste the following contents into palindrome.txt:
A man a plan a canal Panama Able was I ere I saw Elba Outstanding was I since I was here A Santa at NASA
Next, create a new C++ file called Palindrome.cpp.
Write a program to test each phrase in Palindrome.txt to see if it is a palindrome.
For credit, you must use both your Queue and Stack classes in the solution to this problem.
Hint: Convert each individual character to a string and then insert them into your stack and queue.
Print out your results to the console, like what is shown below in the next section.
You may need to review file I/O in C++ to do this assignment.
Your Program Should Give the Following Output:
A man a plan a canal Panama is a palindrome Able was I ere I saw Elba is a palindrome Outstanding was I since I was here isn't a palindrome A Santa at NASA is a palindrome
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