May 2016 Hotels
1 package may2016_hotels;
2
3 public class Client
4 { private int customerID;
5 private String name;
6 private Dates arrive;
7 private Dates leave;
8 private Room bedroom;
9 public Client(int id, String c, Dates dateIn, Dates dateOut, Room r)
10 { setCustomerID(id);
11 setName(c);
12 setArrive(dateIn);
13 setLeave(dateOut);
14 setBedroom(r);
15 }
16 public void setCustomerID(int id) {customerID = id;}
17 public void setName(String c) {name = c;}
18 public void setArrive(Dates dateIn) {arrive = dateIn;}
19 public void setLeave(Dates dateOut) {leave = dateOut;}
20 public void setBedroom(Room r) {bedroom = r;}
21 public int getCustomerID() {return customerID;}
22 public String getName() {return name;}
23 public Dates getArrive() {return arrive;}
24 public Dates getLeave() {return leave;}
25 public Room getBedroom() {return bedroom;}
26 public void bill()
27 { // ...method that calculates the bill for this client
28 }
29 }
30
1 package may2016_hotels;
2
3 public class Dates
4 { private int day;
5 private int month;
6 private int year;
7 public Dates(int day, int month, int year)
8 { this.day = day;
9 this.month = month;
10 this.year = year;
11 }
12 public int getDay() {return day;}
13 public int getMonth() {return month;}
14 public int getYear() {return year;}
15 public static int StayDays(Dates x, Dates y)
16 { // method that calculates the number of nights between x and y
17 return -999; //just so the return red squiggly goes away
18 }
19 }
20
1 package may2016_hotels;
2
3 public class Group
4 {
5 private String name; // name of group
6 private int number; // number of rooms allocated to the group
7 public Group(String name, int number)
8 {
9 this.name = name;
10 this.number = number;
11 }
12 public String getName() {return name;}
13 public int getNumber() {return number;}
14 int[] gRooms = new int[number];
15 // array to hold room numbers allocated to the group
16 public double bill(int[] gRooms)
17 { // ...method that calculates the bill for the group
18 return -999.9;//just to get rid of the red squigglies of the return
19 }
20 }
21
1 package may2016_hotels;
2
3 public class Room {
4 private int roomNumber;
5 private int beds;
6 private double price;
7 private boolean empty;
8
9 public Room(){
10
11 }
12 }
13