while (true)
{
Console.Write ("Please enter the Year:");
int y = Int. Parse (Console.ReadLine ());
if (y >= 1 && y <= 9999)
{
if (y% 4 = = 0 && y% = 0 | | y% 400 = 0)
{
Console.WriteLine ("You have entered a leap year! ");
Console.Write ("Please enter the month:");
int m = Int. Parse (Console.ReadLine ());
if (m>=1&&m <= 12)
{
Console.Write ("Please enter Date:");
int d = Int. Parse (Console.ReadLine ());
if ((((M = = 1 | | m = = 3 | | m = = 5 | | m = = 7 | | m = 8 | | m = = | | m = = && (d>=1&&d <= 31)) | | ( (m = = 4 | | m = = 6 | | m = = 9 | | m = = one) && (d>=1&&d <= 30)) | | (M = = 2 && (d>=1&&d <= 29)))
{
Switch (m)
{
Case 1:console.writeline ("is {1} days of {0} years.") ", y,d);
Break
Case 2:console.writeline ("is {1} days of {0} years.") ", Y, + D);
Break
Case 3:console.writeline ("is {1} days of {0} years.") ", Y, + + + D);
Break
Case 4:console.writeline ("is {1} days of {0} years.") ", Y, + + + + D);
Break
Case 5:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + D);
Break
Case 6:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + D);
Break
Case 7:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + D);
Break
Case 8:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + D);
Break
Case 9:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + + + D);
Break
Case 10:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + + + + + + D);
Break
Case 11:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + + + + + + + + D);
Break
Case 12:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D);
Break
}
Console.WriteLine ("Now {0} year {1} month {2} days!") ", y,m,d);
}
Else
Console.WriteLine ("You are not entering the correct date!") ");
Console.WriteLine ("{0} years is a leap year! ", y);
}
Else
Console.WriteLine ("You are not entering the correct month!") ");
}
Else
{
Console.WriteLine ("You are not entering a leap year! ");
Console.Write ("Please enter the month:");
int m = Int. Parse (Console.ReadLine ());
if (m>=1&&m <= 12)
{
Console.Write ("Please enter Date:");
int d = Int. Parse (Console.ReadLine ());
if ((((M = = 1 | | m = = 3 | | m = = 5 | | m = = 7 | | m = 8 | | m = = | | m = = && (d>=1&&d <= 31)) | | ( (m = = 4 | | m = = 6 | | m = = 9 | | m = = one) && (d>=1&&d <= 30)) | | (M = = 2 && (d>=1&&d <= 28)))
{
Switch (m)
{
Case 1:console.writeline ("is {1} days of {0} years.") ", y, D);
Break
Case 2:console.writeline ("is {1} days of {0} years.") ", Y, + D);
Break
Case 3:console.writeline ("is {1} days of {0} years.") ", Y, + + + D);
Break
Case 4:console.writeline ("is {1} days of {0} years.") ", Y, + + + + D);
Break
Case 5:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + D);
Break
Case 6:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + D);
Break
Case 7:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + D);
Break
Case 8:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + D);
Break
Case 9:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + D);
Break
Case 10:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + + + + + D);
Break
Case 11:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + + + + D);
Break
Case 12:console.writeline ("is {1} days of {0} years.") ", Y, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D);
Break
}
Console.WriteLine ("Now {0} year {1} month {2} days!") ", Y, M, d);
}
Else
Console.WriteLine ("You are not entering the correct date!") ");
Console.WriteLine ("{0} years is not a leap year! ", y);
}
Else
Console.WriteLine ("You are not entering the correct month!") ");
}
}
Else
Console.WriteLine ("You are not entering the correct year!") ");
}
Console.ReadLine ();
Switch Case statement