“The Name Game”
Your niece Cathy thinks the early 1960’s song “The Name Game” by Shirley Ellis is just the cutest
thing, and keeps trying to make it work with the names of all her friends. However, she sometimes gets
confused about just how each name works with the song. So you offer to write her a program that will
let her type in a name, and output the lyrics to the song using that name.
The rules to “The Name Game” are embedded in the song itself:
The first letter of the name, I treat it like it wasn’t there
But a B or an F or an M will appear
And then I say bo add a B then I say the name and Banana fanna and a
And then I say the name again with an F very plain
and a fee fy and a mo
And then I say the name again with an M this time
But if the first two letters are ever the same,
I drop them both and say the name like
Bob, Bob drop the B’s Bo ob
For Fred, Fred drop the F’s Fo red
For Mary, Mary drop the M’s Mo ary
That’s the only rule that is contrary.
Here are a couple of examples:
Shirley, Shirley bo Birley Banana fanna fo Firley
Fee fy mo Mirley, Shirley!
Lincoln, Lincoln bo Bincoln Banana fanna fo Fincoln
Fee fy mo Mincoln, Lincoln!
There are, of course, a few names that you must make sure that you do NOT process, as you do NOT
want Cathy to be singing this song with certain names around your grandmother!! You should be able
to figure out what those are and write some code to reject those names. Use an array to store the list of names (or partial names) that should be checked and banned. Use methods appropriately to break the program into logical tasks.
Submit your source code file and a Word document containing screenshots of the program’s execution with at least three valid names and one filtered name to the iCollege Dropbox.