-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngineer.java
More file actions
62 lines (54 loc) · 1.8 KB
/
Engineer.java
File metadata and controls
62 lines (54 loc) · 1.8 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
55
56
57
58
59
60
61
62
package qldv;
import java.util.Scanner;
public class Engineer extends Person{
private String major;
private int numExp;
public static int sttKS=0;
Engineer(String name, int age, String gender, String add, String phoneNum, String homeTown, String code, int coSalary, int dayofWork, String major,int numExp, String setial){
super(name, age, gender, add, phoneNum,homeTown, code, coSalary, dayofWork, setial);
this.major= major;
//this.setial = setial;
this.numExp = numExp;
}
Engineer(){
sttKS++;
setial= String.format("KS%03d",sttKS);
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public int getNumExp() {
return numExp;
}
public void setNumExp(int numExp) {
this.numExp = numExp;
}
@Override
public void Information(){
System.out.println("Nhập thông tin kỹ sư: ");
Scanner sc = new Scanner(System.in);
super.Information();
System.out.print("Ngành học: ");
major = sc.nextLine();
System.out.print("Số năm kinh nghiệm: ");
numExp = Integer.parseInt(sc.nextLine());
}
public void showInformation(){
super.showInformation();
System.out.println("Ngành học: "+ this.major);
System.out.println("Số năm kinh nghiệm: "+ this.numExp);
}
public void Salary(){
double Salary = this.numExp * this.getDayofWork() * this.getCoSalary();
System.out.println("=> Lương: "+ Salary);
System.out.println("\n\n");
}
public void Run(){
Information();
showInformation();
Salary();
}
}