Question
NOTE: In JAVA please This program will prompt the user to enter a number N and then accept N strings from the user. These strings
NOTE: In JAVA please
This program will prompt the user to enter a number N and then accept N strings from the user. These strings will consists only of letters (both uppercase and lowercase), numbers and spaces. You should store the strings in an array. You are required to write a method that accepts a string and return True if it is palindrome, otherwise returns False. (ignoring case and spaces). If a string happens to be a palindrome, add it to result string. After processing all the input, print the result string on the console. Make sure your program conforms to the following requirements.
The method that processes(i.e., checking if the string is palindrome)should not have a print statement. This method returnsTrue if it is palindrome, otherwise returns False. (ignoring case and spaces).(25points)
The output should be printed in a single line(i.e., if a string happens to be a palindrome, add it to result string. After processing all the input, print the result string on the console which is just a single line consisting of all the palindromic strings separated by a ";").The case of the letters in the input should be preserved.(25 points)
A palindrome is defined as a string that reads the same forward and backward. For example, Race car" is a palindrome.
Sample Run
Enter the number of strings: 8
Enter the strings: Race Car
Mountain Dew
BATMAN
Taco Cat
Stressed Desserts
Is Mayonnaise an instrument
swap paws
A Toyotas a Toyota
The palindromes are: Race Car; Taco Cat; Stressed Desserts; swap paws; A Toyotas a Toyota
Step 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