/home/ssingh6/NetBeansProjects/CS1/src/people/Person.java
 1 /*
 2  * To change this license header, choose License Headers in Project Properties.
 3  * To change this template file, choose Tools | Templates
 4  * and open the template in the editor.
 5  */
 6 package people;
 7 
 8 /**
 9  *
10  * @author ssingh6
11  */
12   public class Person implements PersonSpecification {
13      
14     private String firstName;
15     private String lastName;
16     private int month;
17     private int day;
18     private int  year;
19     
20     public Person(String name, int month, int day, int year )
21     {
22         this.firstName= name.substring(0,name.indexOf(" "));
23         this.lastName =  name.substring(name.indexOf(" ")+1);
24         this.month= month;
25         this.day= day;
26         this.year= year;
27     }
28     public String toString()
29     {
30         return  firstName + "," +lastName  +"  born  " +month+"/"+day+"/"+year;
31       
32     }
33 
34     @Override
35     public String firstName() {
36         
37         return firstName;
38     }
39 
40     @Override
41     public String lastName() {
42        return lastName;
43     }
44 
45     @Override
46     public int month() {
47         return month;
48     }
49 
50     @Override
51     public int day() {
52         return day;
53     }
54 
55     @Override
56     public int year() {
57         return year;
58     }
59 
60     @Override
61      public String initials() {
62         return firstName.substring(0,1) + lastName.substring(0,1);
63      }
64      @Override
65      public boolean isBoomer()
66      {
67          return year >=1945 && year <=1964;
68      }
69   }
70 
71 
72