📄 hourlyworker.java
字号:
public class HourlyWorker extends Employee
{
protected float hourlyWage, hoursWorked;
// constructor that takes the name, address, and number
public HourlyWorker(String n, String a, int e, float wage, float hours)
{
super(n, a, e);
hourlyWage = wage;
hoursWorked = hours;
}
// toString method to display the Employee attributes, using super
public String toString()
{
String temp;
temp = super.toString();
temp += "Employee salary: $" + hourlyWage * hoursWorked + "\n";
return temp;
}
} // end of HourlyWorker class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -