#include #include using namespace std; // working version of old macdonald, functions with more than one parameter void EiEio() { cout << "Ee-igh, Ee-igh, oh!" << endl; } void Refrain() { cout << "Old MacDonald had a farm, "; EiEio(); } void HadA(string animal2) { cout << "And on his farm he had a " << animal2 << ", "; EiEio(); } void WithA(string noise) // the principal part of a verse { cout << "With a " << noise << " " << noise << " here" << endl; cout << "And a " << noise << " " << noise << " there" << endl; cout << "Here a " << noise << ", " << "there a " << noise << ", " << " everywhere a " << noise << " " << noise << endl; } void Verse(string animal, string noise) { Refrain(); HadA(animal); WithA(noise); Refrain(); } int main() { Verse("pig", "oink"); cout << endl; Verse("cow", "moo"); cout << endl; Verse("sheep", "mee"); return 0; }