Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write the following answer in JAVA (not javascript). Please provide answer in copyable text. Show input and output. Thanks in advance. 1) A palindrome
Please write the following answer in JAVA (not javascript). Please provide answer in copyable text. Show input and output. Thanks in advance.
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. Write a program that calls an isPalindrome method that returns true or false if the phrase is or is not a palindrome. Your palindromeTester() program should call isPalindrome for each of the test strings listed below. After each line of input, print whether the input string is a palindrome or not. Your is Palindrome() method should ignore case, punctuation, and white space. Your program should have this structure: main() palindrome Tester called from main for each test string boolean isPalindrome (String s) called from palindromeTester You must test your program with all of these strings: "To be or not to be" "A Santa as NASA" Acrobats stab orca" "Senile felines" "A man, a plan, a canal: Panama" Madam, I'm Adama" "Doc, note: I dissent. A fast never prevents a fatness. I diet on cod" "radar" 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 etc. DON'T PRINT IN THE isPalindrome() method, use .toString and print in the main methodStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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