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

📄 carexpense.java

📁 关于汽车的购买系统,收费系统,汽车耗油系统,是早期和同学开发的JAVA程序
💻 JAVA
字号:
/*
 * CarExpense.java
 *
 * Created on 2007年4月18日, 下午10:10
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package homework;

/**
 *
 * @author Administrator
 */
public class CarExpense extends TravelExpense {
    public double km;
    public double costPerKm;
    /** Creates a new instance of CarExpense */
    public CarExpense() {
        this("3000","shopping", "newyork",1000,500);
    }
    public CarExpense(String date,String description,String destination,double km,double costPerKm){
        super(date,description,destination);
        setKm(km);
        setCostPerKm(costPerKm);
        
    }

    public double getKm() {
        return km;
    }

    public void setKm(double km) {
        this.km = km;
    }

    public double getCostPerKm() {
        return costPerKm;
    }

    public void setCostPerKm(double costPerKm) {
        this.costPerKm = costPerKm;
    }
    public double getTotal(){
    return (this.km)*(this.costPerKm);
}
    public double getTax(){
        return 0;
    }
    public String toString(){
       return super.toString()+"\n"+"Kilometers "+this.getKm()+"\n"+"petrol price per km: "+this.getCostPerKm()+"\n"+"Tax:"+this.getTax()+"\n"+"total:"+this.getTotal()+"\n"+"RD_Points:"+this.getRDPoints()+"\n";
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -