From 7c3ea29d60ebee30725c838825d68335ef2af849 Mon Sep 17 00:00:00 2001 From: Sherwin Price Date: Tue, 23 Sep 2025 17:14:14 -0400 Subject: [PATCH] derived implement call --- src/java/lodge/reservationsystem/CabinReservation.java | 5 ++++- src/java/lodge/reservationsystem/HotelReservation.java | 9 ++++++++- src/java/lodge/reservationsystem/HouseReservation.java | 8 +++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/java/lodge/reservationsystem/CabinReservation.java b/src/java/lodge/reservationsystem/CabinReservation.java index 86a441c..9167a00 100644 --- a/src/java/lodge/reservationsystem/CabinReservation.java +++ b/src/java/lodge/reservationsystem/CabinReservation.java @@ -21,7 +21,10 @@ public final class CabinReservation extends Reservation { } public CabinReservation(final Address physical_address) { - this(); + super(); + this.setType('C'); + this.setNumberOfBeds(1); + this.setKitchen(KitchenTypeEnum.Kitchenette); this.setPhysical_address( new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(), physical_address.getZip())); diff --git a/src/java/lodge/reservationsystem/HotelReservation.java b/src/java/lodge/reservationsystem/HotelReservation.java index 5bcf23c..47c13f8 100644 --- a/src/java/lodge/reservationsystem/HotelReservation.java +++ b/src/java/lodge/reservationsystem/HotelReservation.java @@ -30,7 +30,14 @@ public final class HotelReservation extends Reservation{ } public HotelReservation(final Address physical_address) { - this(); + super(); + this.setType('H'); + this.setNumberOfBeds(2); + this.setNumberOfBeds(2); + this.setNumberOfBedRooms(1); + this.setNumberOfBathRooms(1); + this.setNumberOfFloors(1); + this.setKitchen(KitchenTypeEnum.Kitchenette); this.setPhysical_address( new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(), physical_address.getZip())); diff --git a/src/java/lodge/reservationsystem/HouseReservation.java b/src/java/lodge/reservationsystem/HouseReservation.java index e4844f6..8b96db0 100644 --- a/src/java/lodge/reservationsystem/HouseReservation.java +++ b/src/java/lodge/reservationsystem/HouseReservation.java @@ -28,7 +28,13 @@ public final class HouseReservation extends Reservation { } public HouseReservation(final Address physical_address) { - this(); + super(); + this.setType('Z'); + this.setNumberOfBeds(2); + this.setNumberOfBedRooms(1); + this.setNumberOfBathRooms(1); + this.setNumberOfFloors(1); + this.setKitchen(KitchenTypeEnum.Kitchenette); this.setPhysical_address( new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(), physical_address.getZip()));