Class Room

java.lang.Object
  extended by Room

public class Room
extends Object

Describes room objects in a hotel.

Version:
28 July 2008
Author:
JP Vergara

Constructor Summary
Room(double dRate)
          Constructor for Room objects.
 
Method Summary
 String getOccupant()
          Returns the occupant of the room.
 double getRate()
          Returns the daily rate of the room.
 void occupy(String name, int dayIn)
          Causes a room to be occupied.
 int vacate(int dayCheckedOut)
          Causes a room to be vacated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Room

public Room(double dRate)
Constructor for Room objects.

Parameters:
dRate - daily rate for this room
Method Detail

getOccupant

public String getOccupant()
Returns the occupant of the room.

Returns:
occupant name

getRate

public double getRate()
Returns the daily rate of the room.

Returns:
daily rate

occupy

public void occupy(String name,
                   int dayIn)
Causes a room to be occupied.

Parameters:
name - name of the occupant
dayIn - day the room was occupied

vacate

public int vacate(int dayCheckedOut)
Causes a room to be vacated.

Parameters:
dayChecked - day the room was vacated (should be later than check in date)
Returns:
number of days the room was occupied (return 0 if check out date not later than check date)