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

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!