Please send questions to
st10@humboldt.edu .
#include <iostream>
using namespace std;
// Contract: uglyBeerVerse : int -> void
// Purpose: prints the numBottles'th verse of
// "99 Bottles of Beer on the Wall"
// to the screen (but changes the parameter...)
//
// Examples: uglyBeerVerse(89) should cause the
// following to be printed to the screen:
// 89 bottles of beer on the wall,
// 89 bottles of beer!
// Take one down, pass it around,
// 88 bottles of beer on the wall!
//
// by: Sharon M. Tuttle
// last modified: 10-28-03
void uglyBeerVerse(int numBottles)
{
// print the four lines of this verse, starting on a
// new line
cout << endl;
cout << numBottles << " bottles of beer on the wall,"
<< endl;
cout << numBottles << " bottles of beer," << endl;
cout << "take one down, pass it around," << endl;
// ugly --- changing pass-by-value parameter
numBottles = numBottles - 1;
cout << numBottles
<< " bottles of beer on the wall." << endl;
}