I would write a function to validate whether the month, day, and year form a valid date. Here's a partial solution, off the top of my head, so it might not even compile, but it should be plenty to get you going:
1 2 3 4 5 6 7 8 9 10 11 12
bool isValidDate(unsigned year, unsigned month, unsigned day)
{
if (year >= 2000) returnfalse; // no kids
switch (month) {
case 1:
case 3:
if (day > 31) returnfalse;
break;
}
// If you get here then it's good
returntrue;
}