-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTruongPhong.java
89 lines (72 loc) · 2.12 KB
/
TruongPhong.java
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ASM;
import java.io.ObjectStreamConstants;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author DMX
*/
public class TruongPhong extends NhapXuatNV{
double luongTrachNhiem;
public double getLuongTrachNhiem() {
return luongTrachNhiem;
}
public void setLuongTrachNhiem(double luongTrachNhiem) {
this.luongTrachNhiem = luongTrachNhiem;
}
public String getHoTen() {
return hoTen;
}
public void setHoTen(String hoTen) {
this.hoTen = hoTen;
}
public String getMsNv() {
return msNv;
}
public void setMsNv(String msNv) {
this.msNv = msNv;
}
public double getLuong() {
return luong;
}
public void setLuong(double luong) {
this.luong = luong;
}
public TruongPhong() {
}
public TruongPhong(double luongTrachNhiem) {
this.luongTrachNhiem = luongTrachNhiem;
}
public TruongPhong(double luongTrachNhiem, String hoTen, String msNv, double luong) {
super(hoTen, msNv, luong);
this.luongTrachNhiem = luongTrachNhiem;
}
@Override
public double ThuNhap() {
return getLuong()+getLuongTrachNhiem();
}
public void nhapTTTP(){
Scanner sc = new Scanner(System.in);
super.nhapTT();
try {
System.out.printf("Lương trách nhiệm: ");
setLuongTrachNhiem(sc.nextDouble());
System.out.println("\n");
} catch (Exception e) {
System.out.println("Sai thông tin, chọn chức năng 5 để sửa");
}
}
public void xuatTTTP(ArrayList<TruongPhong> dstp){
for(TruongPhong i : dstp ){
System.out.println("Họ tên: "+i.getHoTen());
System.out.println("MSNV: "+i.getMsNv());
System.out.println("Thu nhập: "+i.ThuNhap());
System.out.println("Thuế thu nhập: "+i.thueThuNhap()+"\n");
}
}
}