Question: 1 4 . 1 0 LAB: Palindrome ( Deque ) Instructor note: Eliminate characters that are not letters using the Character.isLetter ( ) method. Example:
LAB: Palindrome Deque
Instructor note:
Eliminate characters that are not letters using the Character.isLetter method.
Example:
A palindrome is a string that reads the same backwards and forwards. Use a deque to implement a program that tests whether a line of
text is a palindrome. The program reads a line, then outputs whether the input is a palindrome or not.
Ex: If the input is:
senile felines!
the output is:
Yes, "senile felines!" is a palindrome.
Ex: If the input is:
rotostor
the output is:
No "rotostor" is not a palindrome.
Ignore punctuation and spacing. Assume all alphabetic characters will be lowercase.
Special case: A onecharacter string is a palindrome.
Hint: The deque must be a Deque of Characters, but ordinary chars will be automatically converted to Characters when added to the deque.A palindrome is a string that reads the same backwards and forwards. Use a deque to implement a program that tests whether a line of text is a palindrome. The program reads a line, then outputs
whether the input is a palindrome or not. Ex: If the input is:
import java.util.Scanner;
import java.util.LinkedList;
import java.util.Deque;
public class LabProgram
public static void mainString args
Scanner scnr new ScannerSystemin;
int j;
String line;
Type your code here.
it shouldn't include the part for entering your input
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
