From 3df280659e48ab21e5e833eaa5c3af7f131ebd62 Mon Sep 17 00:00:00 2001 From: Xander Estevez Date: Sun, 1 Dec 2024 20:13:16 -0600 Subject: [PATCH] Created guest class --- Guest.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Guest.java diff --git a/Guest.java b/Guest.java new file mode 100644 index 0000000..b72b8b7 --- /dev/null +++ b/Guest.java @@ -0,0 +1,35 @@ +import java.time.LocalDate; +public class Guest extends Person { + + public long id_number; + public Status guest_status; + public String password; + + public Guest(){ + super(); + } + public Guest(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 setPassword(String p) {password = p;} + public void setEnum(Status s) {guest_status = s;} + public boolean setEnum(String s) { + try{ + guest_status = Status.valueOf(s); + }catch (Exception e) { + return false; + } + return true; + } + + public long getIDNumber() {return id_number;} + public Status getStatus() {return guest_status;} + + public String toString(){ + return guest_status + ": " + getName() + " -> {\n\t" + + "ID Number: " + id_number + "\n\t" + + "Email Address: " + email_address + "\n}"; + } +} \ No newline at end of file