C++: Programming Problem - 99 Bottles of Beer

Name __________________________________

(10 points) Write a program which prints the verses of the "99 Bottles of Beer on a Wall" song. Each stanza goes something like this

n bottles of beer on the wall.
Take one down and pass it around.
n-1 bottles of beer on the wall.

These stanzas should be repeated going from the input number down to zero. Your loop will therefore go from high to low values. A for loop is the most appropriate for counting, but you may use a while loop if you feel more comfortable with it.

Improved English

Don't attempt this until the basic program is correct. A problem with the straight-forward solution is that it will print the plural "bottles" when there is only one. One solution is to print "bottle(s)", but how would you make the code print "1 bottle" for the last iteration?

If you don't want to sing about beer, you're welcome to change this from "beer bottles" to something else.

Check out this web site that has solutions in 571 programming languages (99-bottles-of-beer.ls-la.net).