A palindrome is a string that reads the same forward and backward, such as radar. Write a

Question:

A palindrome is a string that reads the same forward and backward, such as "radar". Write a static recursive method that has one parameter of type String and returns true if the argument is a palindrome and false otherwise. Disregard spaces and punctuation marks in the string, and consider upper- and lowercase versions of the same letter to be equal. For example, the following strings should be considered palindromes by your method:

"Straw? No, too stupid a fad, I put soot on warts."
"xyzcZYx?"

Your method need not check that the string is a correct English phrase or word. Embed the method in a program, and test it. For an additional challenge, use your palindrome checking method with the file of English words described in Programming Project 11 in Chapter 10 to find the word with the longest palindrome.


Programming Project 11

Based on the log file described in Programming Project 10 write a program to detect cheating.

This could occur if:

  • A racer misses a sensor, which is a sign that the racer may have taken a shortcut.
  • A race split is suspiciously fast, which is a sign that the racer may have hopped in a vehicle.

In this case, a race split faster than 4:30 per mile can be considered suspicious.

The output should be a list of suspected cheaters along with the reason for suspicion.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: