⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 researchexpense.java

📁 关于汽车的购买系统,收费系统,汽车耗油系统,是早期和同学开发的JAVA程序
💻 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 + -