Code in Java Need help on this one 1) A palindrome is a word or phrase that reads the same forward and backwards. A simple
Code in Java
Need help on this one
1) A palindrome is a word or phrase that reads the same forward and backwards. A simple example of a palindrome is the word radar. Toyota is not a palindrome but the phrase A Toyota is a palindrome. Palindromes ignore letter case and punctuation. Write a program that calls a method called isPalindrome that returns true or false if an input phrase is or is not a palindrome. Your palindromeTester() method should call your isPalindrome method using the test cases below. After each line of input, print whether the input string is a palindrome or not. Your program should have this structure: main() palindromeTester() called from main boolean isPalindrome(String s) called from palindromeTester() You will capture the output for your program for the following 8 strings: "To be or not to be" "A Santa as NASA" "Acrobats stab orca" "Senile felines" "A man, a plan, a canal: Panama" "Madam, Im Adama" "Doc, note: I dissent. A fast never prevents a fatness. I diet on cod" "radar" Tip: copy and paste these strings into your tester program to avoid typing them. Your test output should look like this: "To be or not to be" is NOT palindrome "A Santa as NASA" is NOT a palindrome "Acrobats stab orca" is a palindrome Your isPalindrome method must reduce the input string to an array of just lower case alphabetic characters. That is an array of just alphabetic characters after removing spaces and punctuation. Your algorithm must determine whether the array is a palindrome using one for loop. You may use other for loops to filter the string and make your array of characters. Tip: Convert to lower case and remove the spaces and punctuation from the test string BEFORE trying to store the characters into an array (you need to be able to determine the correct size for the array). You are NOT required to use a Scanner for input.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started