Task 4: Age Calculation Function
1. Add a public member function named calculateAge in the Person class that calculates and
returns the age of a person based on the current date and their date of birth.
Task 5: Main Program
1. In the main function, demonstrate the use of the Date and Person classes by:
• Creating an object of the Date class to represent a birthdate.
• Creating an object of the Person class using the default constructor.
• Creating another object of the Person class using the parameterized constructor with
specific values.
• Creating a third object of the Person class using the copy constructor by copying the
second object.
2. Display the details of each person object using the displayInfo member function.
3. Test the calculateAge function to calculate and display the age of each person.
Appendix: Date Type Information
1. Date Functions:
• localtime: Get the current date and time.
• tm: Structure containing the current date and time information.
• You can find these functions in the <ctime> header.
2. Date Operations: To retrieve the current system date:
• tm_mday: Day of the month.
• tm_mon: Months since January (0 to 11).
• tm_year: Years since 1900.