Skip to content

Commit

Permalink
people class created
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Calhoun authored and alina-z7 committed Nov 29, 2024
1 parent 6b12ef5 commit 3c59dd9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions People.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import java.time.LocalDate;

public class Person {
public String first_name;
public String last_name;
public String email_address;
public LocalDate date_of_birth;
public long phone_number;

public Person(){}
public Person(String firstName, String lastName, String emailAddress, LocalDate birthDate, long phoneNumber) {
first_name = firstName.toLowerCase();
last_name = lastName.toLowerCase();
email_address = emailAddress.toLowerCase();
date_of_birth = birthDate;
phone_number = phoneNumber;
}

public String getFirstName(){return first_name;}
public String getLastName(){return last_name;}
public String getName(){return first_name.toUpperCase().charAt(0)+first_name.substring(1) + " " + last_name.toUpperCase().charAt(0)+last_name.substring(1);}
public String getEmailAddress(){return email_address;}
public LocalDate getBirthDate(){return date_of_birth;}
public long getPhoneNumber(){return phone_number;}

public String toString(){
return getName() + " -> {\n\t"
+ date_of_birth.toString() + "\n\t"
+ "Email: " + email_address + "\n\t"
+ "Phone Number" + phone_number + "\n}";
}
}

0 comments on commit 3c59dd9

Please sign in to comment.