Onto my problem.
I am creating a Hotel Bussiness project in java using BlueJ
The classes are as follows:
Hotel - Deals with the major functions of the hotel (i.e guests booking in, finding rooms etc.)
Room - Used to decide whether a room has a sea view and stores the guest that is in the room.
Occupier - For information about the group occupying a room with methods for amount of nights stayed and nights eaten dinner.
I have completed the Room and Occupier classes with no trouble at all.
My downfall is creating the hotel class.
The class has 3 fields so far they are
Expand|Select|Wrap|Line Numbers
- private Room[] Rooms;
- private int Profit;
- private int FreeRooms;
Expand|Select|Wrap|Line Numbers
- public Hotel(int totalRooms)
- {
- Profit = 0;
- FreeRooms = totalRooms;
- setRoom();
- }
Expand|Select|Wrap|Line Numbers
- private void setRoom()
- {
- Rooms = new Room[FreeRooms];
- if (Rooms.SOMETHING % 2 = 0){
- Room.hasSeaView = true;
- }
- else Room.hasSeaView = false;
- }
I have reffered to all of my work books and scoured the interweb but just can't find a decent example to see what to put here.
Thanks in advance.