Question: 1. Palindrome Detector (30 pts) : MUST BE IN JAVA...A palindrome is a phrase that reads the same forwards as it does backwards. For example,

1. Palindrome Detector (30 pts) : MUST BE IN JAVA...A palindrome is a phrase that reads the same forwards as it does backwards. For example, "a man, a plan, canal, Panama." is a palindrome. Ignore white space and punctuation. Write a program that uses a stack to check for palindromes in each line of a text file. The main method should be in a class called FindPalindromes.java.The text file should be provided as a command line argument (remember String[] args from main). Try your program on the example text filepalindromes.txt. Your program should output the palindromes that it finds in the document. For example:

java FindPalindromes palindromes.txt

"a man, a plan, a canal, Panama" is a palindrome.

"Don't nod" is a palindrome.

"Taco Cat!" is a palindrome.

You must write your own MyStack class for this problem. It must be generic, in the sense that you should be able to use this stack with any type of object. Don't use the built in Stack, instead build your stack from java.util.LinkedList. Do not use the builtin push/pop methods from LinkedList.

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!