📄 hotel.java
字号:
package HotelSystem;
class Hotel extends Houses {
private int Id;
private String name;
private String city;
private int rcount = 100;
private int dcount = 100;
private int rprice;
private int dprice;
public int getId() {
return Id;
}
public void setId(int id) {
Id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public int getDcount() {
return dcount;
}
public void setDcount(int dcount) {
if (dcount >= 0) {
this.dcount = dcount;
} else {
System.out.println("普通房间不够!!");
}
}
public int getDprice() {
return dprice;
}
public void setDprice(int dprice) {
if(dprice> 95){
this.dprice = dprice;
}
else
{
System.out.print("金额必须大于95");
}
}
public int getRprice() {
return rprice;
}
public void setRprice(int rprice) {
if (rprice > 45) {
this.rprice = rprice;
} else {
System.out.print("金额必须大于45");
}
}
public int getRcount() {
return rcount;
}
public void setRcount(int rcount) {
if (rcount >= 0) {
this.rcount = rcount;
} else {
System.out.println("豪华房间不够!!");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -