public class Christmas1 { public static void main(String[] args) { for (int day = 1; day <= 12; ++day) { System.out.print("On the " + day); if (day == 1) { System.out.print("st"); } else if (day == 2) { System.out.print("nd"); } else if (day == 3) { System.out.print("rd"); } else { System.out.print("th"); } System.out.println(" day of Christmas"); System.out.println("My true love gave to me"); switch (day) { case 12: System.out.println("Twelve drummers drumming"); case 11: System.out.println("Eleven pipers piping"); case 10: System.out.println("Ten lords a-leaping"); case 9: System.out.println("Nine ladies dancing"); case 8: System.out.println("Eight maids a-milking"); case 7: System.out.println("Seven swans a-swimming"); case 6: System.out.println("Six geese a-laying"); case 5: System.out.println("Five Golden Rings"); case 4: System.out.println("Four colly birds"); case 3: System.out.println("Three French hens"); case 2: System.out.println("Two turtledoves"); case 1: if (day == 1) { System.out.print("A"); } else { System.out.print("And a"); } System.out.println(" partridge in a pair tree."); if (day < 12) { System.out.println(); //empty line after each verse } break; default: System.err.println("Bad day " + day + "."); System.exit(1); } } System.exit(0); } }