Question: In JAVA please 1 0 0 points Write a code to check whether a user input is a palindrome. a . Analyze / trace the
In JAVA please
points
Write a code to check whether a user input is a palindrome.
a Analyzetrace the while statement in the code below with sample data "aabaa" and "aabbaa"
b Keep running your code until a user enters as a sentinel value.
c Apply your own algorithm and test it with "Was it a Cat I saw?" to ensure that it is working
properly.
String s input.nextLine;
int low ;
int high slength;
boolean isPalindrome true;
while low high
if scharAtlow scharAthigh
isPalindrome false;
break;
low;
high;
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
