Question: The following exercises refer to this program shell. Public class Palindrome TestWrapper { final String isMsg = IS a palindrome; final String isNotMsg =
The following exercises refer to this program shell.
Public class Palindrome TestWrapper
{
final String isMsg = " IS a palindrome";
final String isNotMsg = " is NOT a palindrome";
public static void main( String args[] )
{
New PalindromeTestWrapper( );
}
Public PalindromeTestWrapper( )
{
// your code here
}
Public Boolean isPalindrome( String s){
// your code here
}
}
A palindrome is a word that reads the same forwards as backwards. The words tot, madam and racecar are palindromes; the words tote and
Racer are not.
Complete the PalindromeTestWrapper method so that it reads a string from the user, calls isPalindrome to determine if it is a palindrome and displays an appropriate message. Your program must allow the user to repeatedly enter strings.
Complete the isPalindrome method so that it returns true if s is a palindrome and false if it isnt. You must use a stack in your solution algorithm. You must use the Java API class util.Stack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
