//"Age.cpp". This program accepts from the system the current date and // displays this date. Itinputs from the keyboard a user's // date of birth, verifies with the user if these dates // were accepted correctly, then calculates the exact age of // the user in years, months and days and displays this age // together with both dates. //Programmer: ... //Date: 24.04.2002 //At: ... #include //Responsible for the input/output commands #include //Responsible for the screen operations #include //Handles Date and Time operations #include //Handles string processing operations void main() //function 'main' heading { //function'main' body //variables to hold digits extracted from the date int num1,num2,num3,num4,num5,num6; char answer = 'y';//variable to handle the answer int DD; //variable to handle the system current date int MM; //variable to handle the system current month int YY; //variable to handle the system current year int BIRTH_DD; //variable to handle the day of birth int BIRTH_MM; //variable to handle the month of birth int BIRTH_YY; //variable to handle the year of birth int DIFF_DD; //variable to handle the difference between //the current date and the dau of birth int DIFF_MM; //variable to handle the difference between //the current month and the month of birth int DIFF_YY; //variable to handle the difference between //current year and the year of birth int USER_DD; //variable to handle the date entered by //the user int USER_MM; //variable to handle the month entered by //the user int USER_YY; //variable to handle the year entered by //the user int AGE_M; //variable to handle age in months int AGE_D; //variable to handle age in days char date[128]; //variable to hold the system date _strdate (date);//function that accepts the system date //Message explanation of the program content cout<<"Dear user! You are wellcome to run this program!"<>answer; //accepts the answer from the keyboard cout<>BIRTH_DD; //accepts the date //message prompt for the user to enter a month of birth cout<<"Please enter a month of your birth (e.g. 8): "<>BIRTH_MM; //accepts the month //message prompt for the user to enter a year of birth cout<<"Please enter a year of your birth (e.g. 2001): "<>BIRTH_YY; //accepts the year cout<>answer; //accepts the answer cout<>BIRTH_DD; //accepts the birth Day //message prompt for the user to enter a month of birth cout<<"Please enter a month of your birth (e.g. 12): "<>BIRTH_MM; //accepts the birth month //message prompt for the user to enter a year of birth cout<<"Please enter a year of your birth (e.g. 1997): "<>BIRTH_YY; //accepts the birth year cout<>USER_DD; //accepts the user date //message prompt for the user to enter current month cout<<"Please enter the current month (e.g. 6): "<>USER_MM; //accepts the user month //message prompt for the user to enter current year cout<<"Please enter the current year (e.g. 2002): "<>USER_YY; //accepts the user year cout<=USER_DD && BIRTH_MM>=USER_MM) { //calculation of different year, month, date DIFF_YY=USER_YY-BIRTH_YY-1; DIFF_MM=12-BIRTH_MM+USER_MM-1; DIFF_DD=30-BIRTH_DD+USER_DD; } //if the birth day greater that user date //and birth month is less than user month if (BIRTH_DD>USER_DD && BIRTH_MMUSER_MM) { //calculation of different year, month, //date DIFF_YY=USER_YY-BIRTH_YY-1; DIFF_MM=12-BIRTH_MM+USER_MM; DIFF_DD=USER_DD-BIRTH_DD; } //message to confirm that the date was entered correctly cout<<"The current date you entered is: " <=DD && BIRTH_MM>=MM) { //calculation of different year, month, //date DIFF_YY=YY-BIRTH_YY-1; DIFF_MM=12-BIRTH_MM+MM-1; DIFF_DD=30-BIRTH_DD+DD; } //if the birth day is greater that current date //and birth month is less than current month if (BIRTH_DD>DD && BIRTH_MMMM) { //calculation of different year, month, //date DIFF_YY=YY-BIRTH_YY-1; DIFF_MM=12-BIRTH_MM+MM; DIFF_DD=DD-BIRTH_DD; } } //Message to display the date of birth cout<<"The date of your birth is: "<