Allan Didier

Palindrome Recursion

Goals

Students will demonstrate their ability to use recursion by writing a program to check if a word or phrase is a palindrome.

Skills

  • Recursion

Program Details

Write a recursive program to check to see if a string is palindrome. Your program should

  1. Ask the user to input a string from the console and check to see if the string is a palindrome.
  2. Ignore capitals and spaces.
  3. The String methods .toLowerCase, .replaceAll, .charAt, and .substring will help with this program.
  4. Output to the console whether or not the string is a palindrome.
  5. Use a recursive method to check for a palindrome.

Resources

Edhesive T1 Lesson 36: Recursion

Edhesive T1 Lesson 37: Recursion with method returns

AP College Board 10.1: Recursion

AP College Board 10.2: Recursive Searching and Sorting