Question: Develop a Java program with three different methods that each determine whether a string entered by the user is a PALINDROME , per the following
Develop a Java program with three different methods that each determine whether a string entered by the user is a PALINDROME, per the following requirements:
Develop an interface that allows the user to enter a 1) WORD, 2) PHRASE or 3) NUMBER and report back to the user whether the input is a palindrome.
After reporting the results for a given input, allow the user to enter another string to be tested. Provide the abiltity for the user to end the program.
Before checking the users input, filter out all spaces and punctuation.
Each user entry is to be checked by each of three palindrome checkers:
an iterative algorithm;
a recursive algorithm; and
an algorithm that makes meaningful use of both a stack and a queue in determining whether the input is palindromic
Report out the result for each of the three checkers, and include the how long it took to determine the result. Use System.nanoTime() or some other timing mechanism to measure the execution time. Be sure your timing logic focuses on the palindrome testing algorithm and does not include any time for input or output.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
