-
Notifications
You must be signed in to change notification settings - Fork 0
/
CauHinh.java
35 lines (31 loc) · 1.4 KB
/
CauHinh.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
package com.thanhttt.baitaplon;
import java.io.File;
import java.io.FileNotFoundException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Scanner;
public class CauHinh {
public static final SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy");
public static final Scanner sc = new Scanner(System.in);
public static final int MAX_CHOICE = 17;
public void inFile(QuanLyGiangVien qlgv, String s) throws FileNotFoundException, ParseException{
File inGV = new File(s);
Scanner scf = new Scanner(inGV);
while (scf.hasNextLine()){
String line = scf.nextLine();
String[] values = line.split("#");
GiangVien gv = new GiangVien(values[0], values[1], values[2], values[3], values[4], values[5]);
qlgv.them(gv);
}
}
public void inFile(QuanLySinhVien qlsv, String s) throws FileNotFoundException, ParseException{
File inGV = new File(s);
Scanner scf = new Scanner(inGV);
while (scf.hasNextLine()){
String line = scf.nextLine();
String[] values = line.split("#");
SinhVien sv = new SinhVien(values[0], values[1], Integer.parseInt(values[4]), values[2], values[3], values[5]);
qlsv.them(sv);
}
}
}