I'm supposed to write a loop to loop through the days, the write a switch statement for the verses. The program should print out just like the song goes.
For example:
On the 1st day of xmas my true love gave to me,
a partidge in a pear tree
On the 2nd day of xmas my true love gave to me,
Two turtle doves, and
a partidge in a pear tree
Can someone offer me some advice?
public class Xmas
{
public static void main (String[] args)
{
int ID=0;
int verse=0;
int count = 1;
while (count <=12)
{
System.out.println("On the " +count+" day of Xmas, my true love gave to me");
count++;
}
switch(ID)
{
case 1:
System.out.println ("A partridge in a pear tree");
break;
case 2:
System.out.println ("Two turtle doves, and");
break;
case 3:
System.out.println ("Three french hens,");
break;
case 4:
System.out.println ("Four calling birds,");
break;
case 5:
System.out.println ("Five golden rings,");
break;
case 6:
System.out.println ("Six geese a laying,");
break;
case 7:
System.out.println ("Seven swans a swimming,");
break;
case 8:
System.out.println ("Eight maids a milking,");
break;
case 9:
System.out.println ("Nine ladies dancing,");
break;
case 10:
System.out.println ("Ten lords a leaping,");
break;
case 11:
System.out.println ("Eleven pipers piping,");
break;
case 12:
System.out.println ("Twelve drummers drumming,");
}
}
}