engineer.java

来自「在作业1的Employee和EmployeeDemo两个类基础上修改 1」· Java 代码 · 共 33 行

JAVA
33
字号
package com.totyuedu.c69.a20080829;

public class Engineer extends Employee {

    private float gongshu;

    public Engineer(String name, int age, double salary, String tel,
            String address, String position, String department, String boss) {
        super(name, age, salary, tel, address, position, department, boss);
    }

    // the constructor with gongshu
    public Engineer(String name, int age, double salary, String tel,
            String address, String position, String department, String boss,
            float gongshu) {
        super(name, age, salary, tel, address, position, department, boss);
        this.gongshu = gongshu;
    }

    public float getGongshu() {
        return gongshu;
    }

    public void setGongshu(float gongshu) {
        this.gongshu = gongshu;
    }

    // 年消化人月数×300+月薪×2.5
    public double getBonus() {
        return getGongshu() * 300 + getSalary() * 2.5;
    }
}

⌨️ 快捷键说明

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