-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorker.java
More file actions
54 lines (45 loc) · 1.49 KB
/
Worker.java
File metadata and controls
54 lines (45 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package qldv;
import java.util.Scanner;
public class Worker extends Person {
private int level;
public static int sttCN=0;
Worker(String name, int age, String gender, String add, String phoneNum, String homeTown, String code, int coSalary, int dayofWork, int level, String setial){
super(name, age, gender, add, phoneNum,homeTown, code, coSalary, dayofWork, setial);
this.level=level;
// this.setial=setial;
sttCN++;
setial= String.format("CN%03d",sttCN);
}
Worker(){
sttCN++;
setial= String.format("CN%03d",sttCN);
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
@Override
public void Information(){
System.out.println("Nhập thông tin công nhân: ");
Scanner sc = new Scanner(System.in);
super.Information();
System.out.print("Bậc: ");
level = Integer.parseInt(sc.nextLine());
}
public void showInformation(){
super.showInformation();
System.out.println("Bậc: "+ this.level);
}
public void Salary(){
double Salary = this.level * this.getDayofWork() * this.getCoSalary();
System.out.println("=> Lương: "+ Salary);
System.out.println("\n\n");
}
public void Run(){
Information();
showInformation();
Salary();
}
}