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