Question
JAVA problem! The goal of this exercise is to continue practicing writing functions and manipulating strings. A palindrome is a word or sequence that reads
JAVA problem!
The goal of this exercise is to continue practicing writing functions and manipulating strings.
A palindrome is a word or sequence that reads the same forward as backward. Examples of palindromes are racecar or 213312.
Create a predicate function boolean isPalindrome(String word), which returns true if the string argument is a palindrome, and returns false if the string is not a palindrome.
Write a test program that accepts strings as input and tests whether or not each string is a palindrome. The program will terminate when "quit" is entered. An example run is shown below:
This program tests if strings are palindromes. Enter a string: 8448 8448 is a palindrome. Enter a string: count count is not a palindrome. Enter a string: quit
This program tests if strings are palindromes. Enter a string: 213312 213312 is a palindrome. Enter a string: Madam Madam is a palindrome. Enter a string: quit
Warnings
You are not allowed to use the built-in functions sort() and reverse().
Strings are compared using the .equals() function.
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