#include #include using namespace std; // input version of old macdonald, animal and noise are input from user void EiEio() { cout << "Ee-igh, Ee-igh, oh!" << animal << endl; } void Refrain() { cout << "Old MacDonald had a farm, "; EiEio(); } void HadA(string animal) { cout << "And on his farm he had a "; cout << animal; cout << ", "; 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() { string animal; string noise; cout << "Enter the name of an animal: "; cin >> animal; cout << "Enter noise that a " << animal << " makes: "; cin >> noise; cout << endl; Verse(animal, noise); cout << endl; return 0; }