Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java without Arrays and only using String Methods // Question 18a: Write the method below that tests // whether a word is a palindrome

In java without Arrays and only using String Methods

// Question 18a: Write the method below that tests

// whether a word is a palindrome (the same when read

// forward or back, such as "madam"). Test isPalindrome

// using the appropriately modified StringTest program

public static boolean isPalindrome(String dateStr) {

}

// Question 18b: Upgrade isPalindrome so that it can handle

// any phrase (as in, "Madam, I'm Adam"). Copy the logic of

// isPalindrome into isPalindromePhrase below to start.

//

// In testing for a palindrome, disregard all spaces, punctuation

// marks, apostrophes, and other non-alphanumeric characters

// and consider upper and lower case characters the same. Do not

// count an empty string as a palindrome.

// Hint: recall that the character class has static methods:

// - boolean isLetterOrDigit(ch)

// - char toUpperCase(ch)

public static boolean isPalindromePhrase(String dateStr)

{

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

=+What kinds of problems need to be overcome?

Answered: 1 week ago