Question: Part II: The for-loop. In JAVA. You can only use: public static void main(String[] args) { DO NOT USE: public static boolean name (String inputStr)

 Part II: The for-loop. In JAVA. You can only use: public

Part II: The for-loop. In JAVA. You can only use: public static void main(String[] args) { DO NOT USE: public static boolean name (String inputStr) { Write a program to prompt for a string. The program will determine if the input string is or is not a palindrome. A palindrome reads the same forward as backward. For example, words like radar and Bob" are both palindromes. Phrases can be palindromes too: Go deliver a dare, vile dog!" "Campus motto: Bottoms up Mac." Madam I'm Adam. "A man a plan a canal: Panama." 110010011 Testing a string requires modifying the input string. Follow these steps one-at-a-time: The string's letters (A-Z and a-z) should be converted to either all uppercase or lowercase letters. Look at the string-methods posted on the course website; and, use the method to convert to uppercase (or lowercase). The string should be stripped of all white space characters and punctuation marks. A string like "Madam I'm Adam." converts to the filtered string "madamimadam" after the punctuation and white spaces are removed. (see the tutorial) Make a backward copy of the filtered string (see the tutorial) Compare the filtered string to its backward copy and determine if the two strings are the same. This requires a for-loop, an if-control structure, and the strObj.charAt(index) method. If all the characters match, the string is a palindrome. Input: "Once upon a time, the output is The input string: '%s' is NOT a palindrome. Input: Madam I'm Adam. the output is The input string '%s' IS a palindrome

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!