Q1: How do you detect and output an error message if the input date is after 7/26/97? Q2: How do I get my program to accept dates that are after the month 7 during all other legal years, but not for 1997?
Q1: How do you detect and output an error message if the input date is after 7/26/97? A1: WATCH OUT! PA #7 will have it's "today date" as 7/24/97. Therefore a legal date is 7/24/97 and an ILLEGAL date is *** 7/25/97 *** const int YEAR = 1997; cout << " Enter birth year: "; cin >> yr; if ( year > YEAR ) // like this cout << "ERROR date is later than today\n";

Q2: How do I get my program to accept dates that are after the month 7 during all other legal years, but not for 1997? A2: Look at page 12 of PA handout for the sample output of PA#7. If the date entered is after today (1998) then type in ALL year month date OVER! OH! That means another loop around the whole "Enter year, .. Enter month, Enter day" Therefore nest all of those into *ANOTHER* loop. Notice, after the month is entered then you test if the date entered is after today's date. If it is then reenter the entire yr, mon, day.

HOME || Course Description || Course Outline || Lab Hours || FAQ || Midterm || Final