Employee: firstNamelastNamesocialSecurityNumberSalaridEmployee: weeklySalary(周薪)HourlyEmployee: wage(每小时的工钱)hours(月工作小时数)CommisionEmployee: grossSales(销售额)commissionRate(提成比率)BasePlusCommisionEmployee: baseSalary(月基本工资)Employee类中定义了抽象方法earning,用于计算员工的月工资。SalaridEmployee月工资计算为:weeklySalary4HourlyEmployee月工资计算为:wagehoursCommisionEmployee月工资计算为:grossSalescommissionRateBasePlusCommisionEmployee月工资计算为:grossSalescommissionRate+baseSalary
2022-11-02 20:28:14
10KB
继承的应用
1