int i = 0;
bool isContinue = false;
while (!isContinue)
{
Console.WriteLine("When is Christmas Day?");
i = int.Parse(Console.ReadLine());
if (i == 25)
{
Console.WriteLine("You got it right!, its December 25th!");
Console.ReadLine();
break;
}
else if (i > 31)
{
Console.WriteLine("December has only 31 days, Try AGAIN!");
Console.WriteLine("");
}
else
{
Console.WriteLine("Wrong number. Please try again.");
Console.WriteLine("");
}
}
I would like to add an array inside my program, any possibilities will do. My program is, you need to guess what day is Christmas day, and would like to add some array in it. If its possible we can change the program but it needs if - else, array, and loops.
Aucun commentaire:
Enregistrer un commentaire