#include int stanzachoice; void sta1(), sta2(), sta3(), sta4(), sta5(), sta6(), sta7(), sta8(), sta9(), sta10(), sta11(), sta12(), sta13(), sta14(); void sta15(), sta16(), sta17(), sta18(); decision(); int main() { cout << "Hello!\nThis program is designed to help you memorize" " \n\"The Walrus and The Carpenter\", by Lewis Carroll. \n\nYou can" " get to each stanza by typing its number. \n\tFor example, you could type" " 1, then read stanza #1,\n\ttype 2, read stanza #2,\n\tor type 10, and read stanza #10..." " \n\tSo, you access each stanza by its #. \nThere are 18 stanzas.\nTo quit, type the # 0.\n" "Which stanza would you like? (1 - 18): "; decision(); return 0; } int decision() { cin >> stanzachoice; cout << endl; switch(stanzachoice) { case 0: return 0; case 1: sta1(); break; case 2: sta2(); break; case 3: sta3(); break; case 4: sta4(); break; case 5: sta5(); break; case 6: sta6(); break; case 7: sta7(); break; case 8: sta8(); break; case 9: sta9(); break; case 10: sta10(); break; case 11: sta11(); break; case 12: sta12(); break; case 13: sta14(); break; case 14: sta14(); break; case 15: sta15(); break; case 16: sta16(); break; case 17: sta17(); break; case 18: sta18(); break; default: cout << "Please enter a number between 1 and 18 only.\nType 0 (zero) to quit.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; return decision(); break; } } void sta1() { cout << "The sun was shining on the sea,\n" "Shining with all his might:\n" "He did his very best to make\n" "The billows smooth and bright--\n" "And this was odd, because it was\n" "The middle of the night.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta2() { cout << "The moon was shining sulkily,\n" "Because she thought the sun\n" "Had got no business to be there\n" "After the day was done--\n" "\"It's very rude of him,\" she said,\n" "\"To come and spoil the fun!\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta3() { cout << "The sea was wet as wet could be,\n" "The sands were dry as dry.\n" "You could not see a cloud, because\n" "No cloud was in the sky;\n" "No birds were flying overhead--\n" "There were no birds to fly.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta4() { cout << "The Walrus and the Carpenter\n" "Were walking close at hand;\n" "They wept like anything to see\n" "Such quantities of sand:\n" "\"If this were only cleared away,\"\n" "They said, \"it would be grand!\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta5() { cout << "\"If seven maids with seven mops\n" "Swept it for half a year,\n" "Do you suppose,\" the Walrus said,\n" "\"That they could get it clear?\"\n" "\"I doubt it,\" said the Carpenter,\n" "And shed a bitter tear.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta6() { cout << "\"O Oysters, come and walk with us!\"\n" "The Walrus did beseech.\n" "\"A pleasant walk, a pleasant talk,\n" "Along the briny beach:\n" "We cannot do with more than four,\n" "To give a hand to each.\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta7() { cout << "The eldest Oyster looked at him,\n" "But never a word he said:\n" "The eldest Oyster winked his eye,\n" "And shook his heavy head--\n" "Meaning to say he did not choose\n" "To leave the oyster-bed.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta8() { cout << "But four young Oysters hurried up,\n" "All eager for the treat:\n" "Their coats were brushed, their faces washed,\n" "Their shoes were clean and neat--\n" "And this was odd, because, you know,\n" "They hadn't any feet.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta9() { cout << "Four other Oysters followed them,\n" "And yet another four;\n" "And thick and fast they came at last,\n" "And more, and more, and more--\n" "All hopping through the frothy waves,\n" "And scrambling to the shore.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta10() { cout << "The Walrus and the Carpenter\n" "Walked on a mile or so,\n" "And then they rested on a rock\n" "Conveniently low:\n" "And all the little Oysters stood\n" "And waited in a row.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta11() { cout << "\"The time has come,\" the Walrus said,\n" "\"To talk of many things:\n" "Of shoes--and ships--and sealing-wax--\n" "Of cabbages--and kings--\n" "And why the sea is boiling hot--\n" "And whether pigs have wings.\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta12() { cout << "\"But wait a bit,\" the Oysters cried,\n" "\"Before we have our chat;\n" "For some of us are out of breath,\n" "And all of us are fat!\"\n" "\"No hurry!\" said the Carpenter.\n" "They thanked him much for that.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta13() { cout << "\"A loaf of bread,\" the Walrus said,\n" "\"Is what we chiefly need:\n" "Pepper and vinegar besides\n" "Are ery good indeed--\n" "Now if you're ready, Oysters dear,\n" "We can begin to feed.\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta14() { cout << "\"But not on us!\" the Oysters cried,\n" "Turning a little blue.\n" "\"After such kindness, that would be\n" "A dismal thing to do!\"\n" "\"The night is fine,\" the Walrus said.\n" "\"Do you admire the view?\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta15() { cout << "\"It was so kind of you to come!\n" "And you are so very nice!\"\n" "The Carpenter said nothing but\n" "\"Cut us another slice:\n" "I wish you were not quite so deaf--\n" "I've had to ask you twice!\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta16() { cout << "\"It seems a shame,\" the Walrus said,\n" "\"To play them such a trick,\n" "After we've brought them out so far,\n" "And made them trot so quick!\"\n" "The Carpenter said nothing but\n" "\"The butter's spread too thick!\"\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta17() { cout << "\"I weep for you,\" the Walrus said:\n" "\"I deeply sympathize.\"\n" "With sobs and tears he sorted out\n" "Those of the largest size,\n" "Holding his pocket-handkerchief\n" "Before his streaming eyes.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); } void sta18() { cout << "\"O Oysters,\" said the Carpenter,\n" "\"You've had a pleasant run!\n" "Shall we be trotting home again?\"\n" "But answer came there none--\n" "And this was scarcely odd, because\n" "They'd eaten every one.\n"; cout << "\nWhich stanza would you like? (1 - 18): "; decision(); }