as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
design an algorithm to identify a person's age from their date of birth.
user
step 1: get the date of birth from the user.

step 2: calculate the current year.

step 3: calculate the difference between the current year and the year of birth.

step 4: add 1 to the difference if the current month is lower than the month of birth.

step 5: if the current day is lower than the day of birth, then subtract 1 from the difference.

step 6: the difference is the age of the person.
assistant