-
Notifications
You must be signed in to change notification settings - Fork 1
/
DanhSachDoiTuongNhanVien.java
59 lines (54 loc) · 1.75 KB
/
DanhSachDoiTuongNhanVien.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
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package codeptit;
import java.util.*;
import java.math.*;
/**
*
* @author Administrator
*/
class NhanVien{
private String id;
private String hoTen;
private String gioiTinh;
private String ngaySinh;
private String diaChi;
private String maSoThue;
private String ngayKy;
public NhanVien(int id, String hoTen, String gioiTinh, String ngaySinh, String diaChi, String maSoThue, String ngayKy) {
this.id = String.format("%05d", id);
this.hoTen = hoTen;
this.gioiTinh = gioiTinh;
this.ngaySinh = ngaySinh;
this.diaChi = diaChi;
this.maSoThue = maSoThue;
this.ngayKy = ngayKy;
}
@Override
public String toString() {
return this.id + " " + this.hoTen + " " + this.gioiTinh + " " + this.ngaySinh
+ " " + this.diaChi + " " + this.maSoThue + " " + this.ngayKy;
}
}
public class DanhSachDoiTuongNhanVien {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
ArrayList<NhanVien> a = new ArrayList<>();
sc.nextLine();
for(int i=0; i<n; i++){
String hoTen = sc.nextLine();
String gioiTinh = sc.nextLine();
String ngaySinh = sc.nextLine();
String diaChi = sc.nextLine();
String maSoThue = sc.nextLine();
String ngayKy = sc.nextLine();
a.add(new NhanVien(i+1, hoTen, gioiTinh, ngaySinh, diaChi, maSoThue, ngayKy));
}
for(NhanVien i : a){
System.out.println(i);
}
}
}