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

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