Script started on Tue Sep 14 14:46:38 1999 strauss[2:46pm] [~/Class/cisc181/examples/]> cat 07-12-days.cc // Program plays the 12 days of christmas song // Exercise 2.63 from D&D #include main () { int day; cout << "The Twelve Days of Christmas " << endl << endl; for (day = 1; day <= 12; day++) { cout << "On the "; switch (day) { case 1: cout << "first "; break; case 2: cout << "second "; break; case 3: cout << "third "; break; case 4: cout << "forth "; break; case 5: cout << "fifth "; break; case 6: cout << "sixth "; break; case 7: cout << "seventh "; break; case 8: cout << "eighth "; break; case 9: cout << "ninth "; break; case 10: cout << "tenth "; break; case 11: cout << "eleventh "; break; case 12: cout << "twelth "; break; } cout << "day of christmas my true love gave to me " << endl; switch (day) { case 12: cout << "\t 12 drummers drumming, " << endl; case 11: cout << "\t 11 pipers piping, " << endl; case 10: cout << "\t 10 lords a-leaping, " << endl; case 9: cout << "\t 9 ladies dancing, " << endl; case 8: cout << "\t 8 maids a-milking, " << endl; case 7: cout << "\t 7 swans a-swimming, " << endl; case 6: cout << "\t 6 geese a-laying, " << endl; case 5: cout << "\t 5 golden rings, " << endl; case 4: cout << "\t 4 calling birds, " << endl; case 3: cout << "\t 3 french hens, " << endl; case 2: cout << "\t 2 turtle doves, and" << endl; case 1: cout << "\t a partridge in a pear tree. " << endl; } cout << endl; } return 0; } strauss[2:46pm] [~/Class/cisc181/examples/]> a.out Input size of square (a number between 1 and 20): ^C strauss[2:47pm] [~/Class/cisc181/examples/]> CC 07-12-days.cc strauss[2:47pm] [~/Class/cisc181/examples/]> a.out The Twelve Days of Christmas On the first day of christmas my true love gave to me a partridge in a pear tree. On the second day of christmas my true love gave to me 2 turtle doves, and a partridge in a pear tree. On the third day of christmas my true love gave to me 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the forth day of christmas my true love gave to me 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the fifth day of christmas my true love gave to me 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the sixth day of christmas my true love gave to me 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the seventh day of christmas my true love gave to me 7 swans a-swimming, 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the eighth day of christmas my true love gave to me 8 maids a-milking, 7 swans a-swimming, 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the ninth day of christmas my true love gave to me 9 ladies dancing, 8 maids a-milking, 7 swans a-swimming, 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the tenth day of christmas my true love gave to me 10 lords a-leaping, 9 ladies dancing, 8 maids a-milking, 7 swans a-swimming, 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the eleventh day of christmas my true love gave to me 11 pipers piping, 10 lords a-leaping, 9 ladies dancing, 8 maids a-milking, 7 swans a-swimming, 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. On the twelth day of christmas my true love gave to me 12 drummers drumming, 11 pipers piping, 10 lords a-leaping, 9 ladies dancing, 8 maids a-milking, 7 swans a-swimming, 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree. strauss[2:47pm] [~/Class/cisc181/examples/]> exit strauss[2:47pm] [~/Class/cisc181/examples/]> exit script done on Tue Sep 14 14:47:31 1999