Student Project

Palindromes Student Project
Ability Level: Advanced
Estimated Time: 50 minutes
Objectives: Advanced string manipulation
Materials and Resources:
  • Visual Basic Software
  • Textbook
Overview: A palindrome is a word or phrase that reads the same backwards as forwards.

Some common examples are "Mom", "Dad", "Bob" or even the sentence

"Madam, I'm Adam." When determining a palindrome, the case of letters is

ignored, as is any spacing or punctuation if the phrase happens to be a

sentence.

The goal of this program is to determine if a word or phrase is a palindrome and

to determine if any sub-strings of words or phrases are palindromes. Case and

punctuation are ignored. Only the 26 letters (a...z) and 10 numbers (0...9) are to

be considered.

Instructions: PROJECT INSTRUCTIONS:

1. Create a text box to accept the possible palindrome.

2. Create a second text box to accept the size of palindromes to find.

3. Create a picture box to display the palindromes found in the input text box.

4. Write code in a command button routine to check for palindromes.

5. If sub string palindromes were requested, display any palindromes found

in a picture box.

6. Display a message box if not palindromes were found.

7. Create an end program option

Hints: SUGGESTED SOLUTION:

Consider creating a Boolean function to examine a string and return True if the

string is a palindrome. Examine the whole string by sending the contents of the

text box to this function. Search for smaller palindromes by sending a number of

sub-strings to the function.

 

PROJECT EXTRAS:

Display a count of the number of palindromes found.