-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTwelveDaysOfChristmas.java
More file actions
110 lines (87 loc) · 3.39 KB
/
Copy pathTwelveDaysOfChristmas.java
File metadata and controls
110 lines (87 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
public class TwelveDaysOfChristmas {
public static void main(String[] args) {
System.out.println("🎄 THE TWELVE DAYS OF CHRISTMAS 🎄\n");
for (int day = 1; day <= 12; day++) {
System.out.print("On the ");
switch (day) {
case 1:
System.out.print("first");
break;
case 2:
System.out.print("second");
break;
case 3:
System.out.print("third");
break;
case 4:
System.out.print("fourth");
break;
case 5:
System.out.print("fifth");
break;
case 6:
System.out.print("sixth");
break;
case 7:
System.out.print("seventh");
break;
case 8:
System.out.print("eighth");
break;
case 9:
System.out.print("ninth");
break;
case 10:
System.out.print("tenth");
break;
case 11:
System.out.print("eleventh");
break;
case 12:
System.out.print("twelfth");
break;
}
System.out.println(" day of Christmas, my true love sent to me");
for (int gift = day; gift >= 1; gift--) {
switch (gift) {
case 12:
System.out.println("Twelve drummers drumming,");
break;
case 11:
System.out.println("Eleven pipers piping,");
break;
case 10:
System.out.println("Ten lords a-leaping,");
break;
case 9:
System.out.println("Nine ladies dancing,");
break;
case 8:
System.out.println("Eight maids a-milking,");
break;
case 7:
System.out.println("Seven swans a-swimming,");
break;
case 6:
System.out.println("Six geese a-laying,");
break;
case 5:
System.out.println("Five golden rings,");
break;
case 4:
System.out.println("Four calling birds,");
break;
case 3:
System.out.println("Three French hens,");
break;
case 2:
System.out.println("Two turtle doves and");
break;
case 1:
System.out.println("A partridge in a pear tree");
break;
}
}
}
}
}