Ten Green Bottles Write a program that returns the lyrics to the classic children's song.
Lyrics Hint: pay particular attention to the penultimate and final verses!
Ten green bottles Hanging on the wall Ten green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be nine green bottles Hanging on the wall
Nine green bottles Hanging on the wall Nine green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be eight green bottles Hanging on the wall
Eight green bottles Hanging on the wall Eight green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be seven green bottles Hanging on the wall
Seven green bottles Hanging on the wall Seven green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be six green bottles Hanging on the wall
Six green bottles Hanging on the wall Six green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be five green bottles Hanging on the wall
Five green bottles Hanging on the wall Five green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be four green bottles Hanging on the wall
Four green bottles Hanging on the wall Four green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be three green bottles Hanging on the wall
Three green bottles Hanging on the wall Three green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be two green bottles Hanging on the wall
Two green bottles Hanging on the wall Two green bottles Hanging on the wall And if one green bottle Should accidentally fall There'll be one green bottle Hanging on the wall
One green bottle Hanging on the wall One green bottle Hanging on the wall If that one green bottle Should accidentally fall There'll be no green bottles Hanging on the wall
APPROACH: 10 verses String interpolation for the number of green bottles. The final verse is different, so return slightly modified version of the verse.
Extension Options Generate the lyrics for Ninety-Nine Green Bottles.
Write a Green Bottles lyrics generator that will take a given number, and return the lyrics from that number onwards.# tenGreenBottles