public static void main(String ... args)
{
Scanner sc = new Scanner(System.in);
int given;
do
{
System.out.print("Enter month in number format [1-12]: ");
given = sc.nextInt();
System.out.println();
} while(given > 12 || given <= 0);
switch(given)
{
case 11:
System.out.println("Sun\tMon\tTue\tWed\tThu\tFri\tSat");
for(int y = 1; y <= 1; y++)
{
for (int x = 1; x <=31 ; x++)
{
System.out.print(x + "\t");
if(x % 7 ==0)
System.out.println();
}
}
break;
Does anyone have any idea how to format the other months without using calendar class or any fancy code and just pure nested loops? Thank you.