68
Microsoft Visual C++/CLI Step by Step
In this exercise, you will enhance your Calendar Assistant application to display the season for the
user’s date.
1.
Continue working with the project from the previous exercise.
2.
Modify the DisplayDate function. After displaying the year, month, and day, add the following
code after the line Console::Write(day) to display the season:
switch (month)
{
case 12:
case 1:
case 2: Console::WriteLine(" [Winter]"); break;
case 3:
case 4:
case 5: Console::WriteLine(" [Spring]"); break;
case 6:
case 7:
case 8: Console::WriteLine(" [Summer]"); break;
case 9:
case 10:
case 11: Console::WriteLine(" [Fall]"); break;
}
Do'stlaringiz bilan baham: |