|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Hotel
public class Hotel
Implements a Hotel with the use of an array
Constructor Summary | |
---|---|
Hotel()
Constructor for a Hotel object. |
Method Summary | |
---|---|
void |
addRoom(int roomNumber,
double rate)
Adds a new room to the Hotel |
void |
changeRoomRate(int roomNumber,
double newDailyRate)
Changes a room's daily rate |
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 Returns the amount charged to the occupant (return 0 for error cases) |
Room |
findRoom(int roomNumber)
Locates the room, given the room number. |
String |
getOccupant(int roomNumber)
Returns the current occupant of the given room. |
double |
getTotalCash()
Returns the total cash collections for the hotel. |
void |
printSummary()
Prints the room number and current occupant of each room of the hotel If room is not occupied, prints "no occupant" |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Hotel()
Method Detail |
---|
public void addRoom(int roomNumber, double rate)
roomNumber
- room numberrate
- daily rate of the roompublic void changeRoomRate(int roomNumber, double newDailyRate)
roomNumber
- the room numbernewDailiyRate
- the new rate of the roompublic void checkIn(int roomNumber, String occupantName, int day)
roomNumber
- the room numberoccupantName
- name of the occupantday
- the day the occupant wishes to check inpublic double checkOut(int roomNumber, int day, double extraCharges)
roomNumber
- the room numberday
- the day the occupant will check outextraCharges
- any extra charges (beyond the room rate)
public Room findRoom(int roomNumber)
roomNumber
- room number being searched
public String getOccupant(int roomNumber)
roomNumber
- the room number
public double getTotalCash()
public void printSummary()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |