#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 animal3) { cout << "And on his farm he had a " << animal3 << ", "; 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 Cow() { Refrain(); HadA("cow"); WithA("moo"); Refrain(); } void Pig() { Refrain(); HadA("pig"); WithA("oink"); Refrain(); } void Sheep() { Refrain(); HadA("sheep"); WithA("mee"); Refrain(); } int main() { Cow(); cout << endl; Pig(); cout << endl; Sheep(); return 0; }