From 8e1c4d97b853073c58f86a5e18718ceff099a76d Mon Sep 17 00:00:00 2001 From: andrewdo Date: Fri, 29 Nov 2024 14:59:09 -0600 Subject: [PATCH] added member class --- Member.java | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Member.java diff --git a/Member.java b/Member.java new file mode 100644 index 0000000..bd5d664 --- /dev/null +++ b/Member.java @@ -0,0 +1,33 @@ +import java.time.LocalDate; + +public class Member extends Person { + + public Long id_number; + public LocalDate creation_date; + public LocalDate expiration_date; + public LocalDate last_checked_in; + + public Member(){super();} + public Member(String firstName, String lastName, String emailAddress, LocalDate birthDate, long phoneNumber) { + super(firstName, lastName, emailAddress, birthDate, phoneNumber); + } + + public void setIdNumber(long number) {id_number = number;} + public void setCreationDate(LocalDate date) {creation_date = date;} + public void updateLastCheckedIn() {last_checked_in = LocalDate.now();} + public void updateExpirationDate(LocalDate date) {expiration_date = date;} + + public long getIDNumber() {return id_number;} + public LocalDate getCreationDate(){return creation_date;} + public LocalDate getExpirationDate(){return expiration_date;} + public LocalDate getLastCheckedInDate(){return last_checked_in;} + + public String toString(){ + return "MEMBER: " + getName() + " -> {\n\t" + + "Id Number: " + id_number + "\n\t" + + "Membership Created on: " + creation_date.toString() + "\n\t" + + "Membership Expires on: " + expiration_date.toString() + "\n\t" + + "Last Checked in on: " + last_checked_in.toString() + "\n\t" + + "Email: " + id_number + "\n}"; + } +} \ No newline at end of file