Question: (JAVA) A palindrome is spelled the same forwards as backwards such as: Able was I ere I saw Elba Step on no pets Devil lived

(JAVA)

A palindrome is spelled the same forwards as backwards such as: Able was I ere I saw Elba Step on no pets Devil lived Rats Live on no evil star

We can also break down a string for analysis into its component characters using built in character methods: Character.isSpaceChar(ch) Character.isLetter(ch) Character.isDigit(ch) Character.isUpperCase(ch) Character.isLowerCase(ch)

Allow the user to enter a multiple word string including blanks Create a reversed string and compare that to the original string. If they are identical then the original is a palindrome, spelled identically forwards and backwards. Upper and lower case do not differentiate for the palindrome comparison! Break the original string into its component characters and display the number of: Blank spaces Letters Digit symbols Uppercase letters Lowercase letters Number of punctuation marks (i.e. comma, period, question marks, semicolons, colons, single and double quotations, hyphens, etc.). ASCII integer values from 37 to 47 are the punctuation marks.

Tactical hints: Determine the number of character positions in the string (i.e. string1.length( ) ) Find an individual string or character with the string1.charAt(n) Strings positions run from 0 to N 1 (N is the length of the string)

Example Output: You entered "Able was I ere I saw Elba" containing 24 characters Backwards it is "ablE was I ere I saw elbA" "Able was I ere I saw Elba" is a Palindrome since it is identical to "ABLE WAS I ERE I SAW ELBA"

The Original String "Able was I ere I saw Elba" contains

Text Statistics are: 24 Characters in "Able was I ere I saw Elba" Number of blanks are 6 Number of letters are 19 Number of digits are 0 Number of UPPER Case letters are 4 Number of lower case letters are 15

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!