Write a program to play the name game.
Input
Your program should accept a single name as input from the user in some way (e.g read from standard input or as a command-line argument). You can assume that the name is a single word consisting of an upper case letter followed by one or more lower case letters.
Output
Your program must print the rhyme for the given name, as explained in the song, by filling out the following template:
(X), (X), bo-b(Y)
Banana-fana fo-f(Y)
Fee-fi-mo-m(Y)
(X)!
Here, (X) is the original name, and (Y) is the name in lower case with any initial consonants removed.
There is one exception, however. If the original name began with m, f or b, it should be written without this letter on the corresponding line. E.g. if the name was Bob, the "b" line should end with bo-ob. Note that in this case, any other consonants are kept, so for Fred it's fo-red, not fo-ed.
Examples
Shirley:
Shirley, Shirley, bo-birley
Banana-fana fo-firley
Fee-fi-mo-mirley
Shirley!
Arnold:
Arnold, Arnold, bo-barnold
Banana-fana fo-farnold
Fee-fi-mo-marnold
Arnold!
Bob:
Bob, Bob, bo-ob
Banana-fana fo-fob
Fee-fi-mo-mob
Bob!
Fred:
Fred, Fred, bo-bed
Banana-fana fo-red
Fee-fi-mo-med
Fred!
Scoring
Shortest code wins.
Yis handled as a vocal, soYvesis likeIvesorArnold. – user unknown Nov 7 '11 at 2:14Yas a vowel only if it's followed by a consonant. That should cover those cases at least. – hammar Nov 7 '11 at 12:44