Class Hotel

java.lang.Object
  extended by Hotel

public class Hotel
extends Object

Describes a Hotel object containing three rooms. The rooms are numbered 101, 102, and 103. The daily room rates are: P2000.00 for Room 101, P2500.00 for Room 102, and P3000.00 for Room 103.

Version:
28 July 2008
Author:
JP Vergara

Constructor Summary
Hotel()
          Constructor for a Hotel object.
 
Method Summary
 void checkIn(int roomNumber, String occupantName, int day)
          Facilitates checking into a room.
 double checkOut(int roomNumber, int day, double extraCharges)
          Facilitates checking out of a room.
 String getOccupant(int roomNumber)
          Returns the current occupant of the given room.
 double getTotalCash()
          Returns the total cash collections for the hotel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hotel

public Hotel()
Constructor for a Hotel object. Createes three room objects.

Method Detail

checkIn

public void checkIn(int roomNumber,
                    String occupantName,
                    int day)
Facilitates checking into a room.

Parameters:
roomNumber - the room number (101, 102, 103)
occupantName - name of the occupant
day - the day the occupant wishes to check in

checkOut

public double checkOut(int roomNumber,
                       int day,
                       double extraCharges)
Facilitates checking out of a room. Returns the amount charged to the occupant (return 0 for error cases)

Parameters:
roomNumber - the room number (101, 102, 103)
day - the day the occupant will check out
extraCharges - any extra charges (beyond the room rate)
Returns:
the amount charged to the occupant

getOccupant

public String getOccupant(int roomNumber)
Returns the current occupant of the given room. Return "not occupied" if not occupied.

Parameters:
roomNumber - the room number (101, 102, 103)
Returns:
the name of the current occupant

getTotalCash

public double getTotalCash()
Returns the total cash collections for the hotel.

Returns:
total cash