I have three classes. My driver class, a Person class, and a Chore class.
I have chores and family members listed in two separate csv files.
The family members file just contains names and dob's (01/01/1901). So the first thing I want to do is calculate each family member's age based on the year in their dob and get the current year then get the difference of the two. How do I select for just the year in each person's dob and how do I get the current year?
public int currentAge(LocalDate dob, LocalDate currentDate){
if ((dob != null) && (currentDate != null)) {
return Period.between(dob, currentDate).getYears();
} else {
return 0;
}
}
public int getCurrentAge(){
return currentAge;
}