1 /* 2 * This class is used to model a person in terms of five properties 3 * - first and last name (String values), and 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 private String Person; 18 19 // CONSTRUCTORS 20 21 public Person(String Name, int m, int d, int yr) { 22 this.firstName = Name; 23 Name = (firstName + " " + lastName); 24 month = m; 25 day = d; 26 year = yr; 27 } 28 29 30 // METHODS 31 32 public String toString() { 33 return ( firstName + " " + ", born " + month + "/" 34 + day + "/" + year); 35 } 36 37 @Override 38 public String firstName() { 39 return firstName; 40 } 41 42 @Override 43 public String lastName() { 44 return lastName; 45 } 46 47 @Override 48 public int month() { 49 return month; 50 } 51 52 @Override 53 public int day() { 54 return day; 55 } 56 57 @Override 58 public int year() { 59 return year; 60 } 61 62 @Override 63 public String initials() { 64 return Person; 65 } 66 67 @Override 68 public boolean isBoomer() { 69 if (year>= 1946 && year<=1964){ 70 return true; 71 } 72 return false; 73 } 74 } 75 76