derived implement call

This commit is contained in:
2025-09-23 17:14:14 -04:00
parent 99218a8eb7
commit 7c3ea29d60
3 changed files with 19 additions and 3 deletions

View File

@@ -21,7 +21,10 @@ public final class CabinReservation extends Reservation {
} }
public CabinReservation(final Address physical_address) { public CabinReservation(final Address physical_address) {
this(); super();
this.setType('C');
this.setNumberOfBeds(1);
this.setKitchen(KitchenTypeEnum.Kitchenette);
this.setPhysical_address( this.setPhysical_address(
new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(), new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(),
physical_address.getZip())); physical_address.getZip()));

View File

@@ -30,7 +30,14 @@ public final class HotelReservation extends Reservation{
} }
public HotelReservation(final Address physical_address) { 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( this.setPhysical_address(
new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(), new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(),
physical_address.getZip())); physical_address.getZip()));

View File

@@ -28,7 +28,13 @@ public final class HouseReservation extends Reservation {
} }
public HouseReservation(final Address physical_address) { 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( this.setPhysical_address(
new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(), new Address(physical_address.getStreet(), physical_address.getCity(), physical_address.getState(),
physical_address.getZip())); physical_address.getZip()));