Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The goal of this assignment is to reinforce the concept of queue data structure and its applications. To keep all submissions uniform, this assignment uses
The goal of this assignment is to reinforce the concept of queue data structure and its applications. To keep all submissions uniform, this assignment uses both stack and queue classes from C++ STL. The assignment asks to design and implement a C++ program (call it testPalindrome.cpp) to test two types of palindromes character-based and word-based. The program provides the user a menu of three options: 1. Test character-by-character palindrome 2. Test word-by-word palindrome 3. Quit program Option 1 is already solved in the textbook, Figure 8.3. Reuse that code as you see fit for this assignment. The solution uses stack and queue objects. Option 2 is the problem described in project #1, page 433. This option tests word-by-word palindromes such that a string of words reads the same forward and backward. Read the problem statement for hints as to how to process word-based palindrome input. In both options, the program asked the user to enter a string and displays the entered string followed by the judgment (Palindrome or Not Palindrome). The output, as shown below. includes the selected option, the entered string, and the program judgment. Implement each option as a separate function in your program, The main program incorporates the menu shown above, similar to previous assignments. The menu is re-displayed after an option is exercised and its output is displayed as shown below. Do Not hard-code test data in the code. Test data is entered using the menu options. Test your code with the following sample inputs and format the output as shown below. You selected: You entered: Judgment: Option 1 Eva, can I see bees in a cave? Palindrome You Selected You entered: Judgment Option 2 You can cage a swallow can't you, but you can't swallow a cage, can you Palindrome You selected: You entered: Judgment: Option 1 Straw? No too stupid a tad. I put soot on warts. Palindrome You selected: You entered: Judgment Option 2 Straw? No too atupid a tad Not Palindrome I put soot on warts
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