Person.java
1    /* 
2     * This will emulate a person in terms of 5 properties, first and last name, and the day, month, and year of their birth. 
3     */
4    
5    package people;
6    
7    public class Person implements PersonSpecification {
8    
9        private String firstName;
10   
11       private String lastName;
12   
13       private int month;
14   
15       private int day;
16   
17       private int year;
18   
19       public Person(String name, int month, int day, int year){
20   
21           this.firstName = name.substring(0, name.indexOf(" "));
22           this.lastName = name.substring(name.indexOf(" ") + 1, name.length());
23   
24           this.month = month;
25           this.day = day;
26           this.year = year;
27   
28       }
29   
30       public String toString(){
31           return
32                   firstName + " " + lastName + ", born " + month + "/" + day + "/" + year;
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           return this.firstName.substring(0, 1) + this.lastName.substring(0, 1);
64       }
65   
66       @Override
67       public boolean isBoomer() {
68           if (year >= 1946 || year <= 1964) {
69               return true;
70           } else {
71               return false;
72           }
73       }
74   }
75