1 /* 2 * this program will model a person in terms of five properties, 3 * first name and last name (String values), month, day, and year of birth (int values) 4 */ 5 6 package people; 7 8 public class Person implements PersonSpecification { 9 10 //Instance Variables 11 12 private String firstName; 13 private String lastName; 14 private int month; 15 private int day; 16 private int year; 17 18 // Constructors 19 20 public Person(String firstName, int month, int day, int year) { 21 this.firstName = (firstName.substring(0,firstName.indexOf(" "))); 22 this.lastName = (firstName.substring(firstName.indexOf(" "),firstName.length()+0)); 23 this.month = month; 24 this.day = day; 25 this.year = year; 26 } 27 28 // Methods 29 30 public String toString() { 31 String output = (firstName + lastName + " " + month + "/" + day + "/" + year); 32 return output; 33 } 34 35 36 @Override 37 public String firstName() { 38 return firstName; 39 } 40 41 @Override 42 public String lastName() { 43 return lastName; 44 } 45 46 @Override 47 public int month() { 48 return month; 49 } 50 51 @Override 52 public int day() { 53 return day; 54 } 55 56 @Override 57 public int year() { 58 return year; 59 } 60 61 @Override 62 public String initials() { 63 String initials = (firstName.substring(0,1) + lastName.substring(1,2)); 64 return initials; 65 } 66 67 @Override 68 public boolean isBoomer() { 69 70 return (year < 1964); 71 } 72 } 73