📄 researchexpense.java
字号:
package homework;
public class ResearchExpense extends Expense {
protected double cost;
protected double tax;
final int RD_COEFF=2;
public ResearchExpense() {
this("3000","shopping",5000,100);
}
public ResearchExpense(String date,String description, double cost,double tax) {
super(date,description)
setCost(cost);
setTax(tax);
}
public void setCost(double cost){
this.cost=cost;
}
double getCost(){
return this.cost;
}
public void setTax(double tax){
this.tax=tax;
}
double getTax(){
return this.tax;
}
double getTotal(){
return this.tax+this.cost;
}
public int getRDPoints(){
return ((int)(this.getCost()))*RD_COEFF;
}
public String toString(){
return super.toString()+" cost: "+this.getCost()+" tax: "+this.getTax()+"\n";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -