:o Yet another question to ask

for the full assignment breif please look at http://www.cems.uwe.ac.uk/~lrlang/java_html/assignment2.html it might make what i'm asking a bit clearer as i'm not very good at explaining myself.

private Booking []
  private int

  public Hotel () {

  } // Hotel ()

this is part of my hotel class. want i want to do is initialise the bookingList array with 100 empty elements. the Booking class has the constructor

public Booking (GuestData inGuests, Room inRoom, HotelDate inStartDate, int inNumberOfDays)

GuestData is another class i have made as are Room and HotelData

i hope i have explain myself

thanks for any help

12 Years
Discussion Span
Last Post by Phaelax

//initialize array with 100 empty Booking objects
private Booking[] bookingList = new Booking[100];

I'd probably use a Vector or ArrayList to maintain the list of current bookings.

When a new guest asks for a room, loop through your Hotel class to find an available room. When you find one, mark that room as occupied and record the necessary data into your booking array.

You'll need to check for the next available booking slot in the array.

Did that clarify things up for you?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.