Question: I need help with this java program: Sample run: Input: A man, a plan, a canal Panama! Output: It is a palindrome Here is the
I need help with this java program:
Sample run:
Input: A man, a plan, a canal Panama!
Output: It is a palindrome
Here is the code:

public class Palindrome App { public static void main(String [] args) { // solve the Palindrome problem here // Hints: // Make an ArrayStack that can only hold Character data // Make a LinkedQueue that can only hold Character data System.out.println("Enter the word or phrase you think is a palindrome: "); i/read a line of text into a string variable // visit each character in the String if a character is a letter, add it to the Stack and Queue // create a flag variable match and set it to true // Now, start a loop that runs until the queue is empty remove one char from the queue and one from the stack if they differ, set match to false // after the loop check match and print the appropriate message }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
