/* * This program will model a person in terms of five properties, first name and last name as string values, and month, * day, and year of birth as int values */ package people; import java.util.ArrayList; public class Person implements PersonSpecification { private String firstName; private String lastName; private int month; private int day; private int year; public Person(String name, int month, int day, int year){ int space = name.indexOf(" "); firstName = name.substring(0, space); lastName = name.substring(space + 1); this.month = month; this.day = day; this.year = year; } @Override public String toString() { return firstName + " " + lastName + ", born " + month + "/" + day + "/" + year; } @Override public String firstName() { return firstName; } @Override public String lastName() { return lastName; } @Override public int month() { return month; } @Override public int day() { return day; } @Override public int year() { return year; } @Override public String initials() { String one = firstName.substring(0,1); String two = lastName.substring(0,1); return one + two ; } @Override public boolean isBoomer() { if (year > 1945 & year < 1965 ) { return true; } else { return false; } } }