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

📄 engineer.java

📁 在作业1的Employee和EmployeeDemo两个类基础上修改 1
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -