-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoom.java
50 lines (38 loc) · 1.07 KB
/
Room.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
public class Room {
private int roomNo;
private String type;
private double pricePerDay;
private boolean availability = true;
static int nextId = 1;
public Room() {}
public Room (String type, double pricePerDay, boolean availability) {
this.type = type;
this.pricePerDay = pricePerDay;
this.availability = availability;
roomNo = nextId++;
}
public int getRoomNo () {
return roomNo;
}
public String getType () {
return type;
}
public double getPricePerDay () {
return pricePerDay;
}
public boolean getAvailability () {
return availability;
}
public void setType (String type) {
this.type = type;
}
public void setPricePerDay (double pricePerDay) {
this.pricePerDay = pricePerDay;
}
public void setAvailability (boolean availability) {
this.availability = availability;
}
public String toString () {
return "Room #: " + roomNo + ", type: " + type + ", price per day: " + pricePerDay + ", available? " + availability;
}
}