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
100 points
Write a code to check whether a user input is a palindrome.
a. Analyze/trace the while statement in the code below with sample data "aabaa" and "aabbaa"
b. Keep running your code until a user enters 0 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 =0;
int high = s.length()-1;
boolean isPalindrome = true;
while (low high){
if (s.charAt(low)!= s.charAt(high)){
isPalindrome = false;
break;
}
low++;
high--;
In JAVA please 1 0 0 points Write a code to check

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 Programming Questions!