Last active
October 21, 2018 10:44
-
-
Save hvnien18it2/ba8761df151a6f0cd0949bf0751c5ec8 to your computer and use it in GitHub Desktop.
HVNiên18it2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Kitucxa; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Scanner; | |
public class Sinhvien { | |
String maSV; | |
String tenSV; | |
String NgayVao; | |
String maPhong; | |
public String getMaSV() { | |
return maSV; | |
} | |
public void setMaSV(String maSV) { | |
this.maSV = maSV; | |
} | |
public String getMaPhong() { | |
return maPhong; | |
} | |
public void setMaPhong(String maPhong) { | |
this.maPhong = maPhong; | |
} | |
public String getTenSV() { | |
return tenSV; | |
} | |
public void setTenSach(String tenSV) { | |
this.tenSV = tenSV; | |
} | |
public String getNgayVao() { | |
return NgayVao; | |
} | |
public void setNgayVao(String NgayVao) { | |
this.NgayVao = NgayVao; | |
} | |
public Sinhvien() { | |
} | |
public Sinhvien(String maSV,String tenSV,String NgayVao,String maPhong) { | |
this.maSV=maSV; | |
this.tenSV=tenSV; | |
this.NgayVao=NgayVao; | |
this.maPhong=maPhong; | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Kitucxa; | |
import java.text.SimpleDateFormat; | |
import java.util.Enumeration; | |
import java.util.Scanner; | |
import java.util.Vector; | |
public class QuanLy { | |
//luu danh sach sinh vien vao vector | |
Vector list = new Vector(); | |
public QuanLy() { | |
while(true) { | |
System.out.println("\n Quan ly sinh vien"); | |
System.out.println("1. Nhap Thong tin"); | |
System.out.println("2. Xem Bao cao"); | |
int n; | |
Scanner key = new Scanner(System.in); | |
System.out.println("Moi ban chon chuc nang:"); | |
n = key.nextInt(); | |
switch(n) { | |
case 1: NhapTT(); | |
break; | |
case 2: InTT(); | |
break; | |
} | |
} | |
} | |
public void NhapTT() { | |
Scanner key = new Scanner(System.in); | |
int n; | |
System.out.println("Nhap so luong sinh vien dang ki:"); | |
n =Integer.parseInt(key.nextLine()); | |
for(int i=0;i<n;i++) { | |
System.out.println("Nhap thong tin sv thu "+(i+1)); | |
System.out.println("Nhap ma sinh vien ="); | |
String maSV=key.nextLine(); | |
System.out.println("Nhap ma phong dang ki = "); | |
String maPhong=key.nextLine(); | |
System.out.println("Nhap ten sinh vien: "); | |
String tenSV=key.nextLine(); | |
System.out.println("Nhap phi o tro/thang :"); | |
int sl=Integer.parseInt(key.nextLine()); | |
System.out.println("Ngay dang ki:"); | |
SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd"); | |
String NgayVao=key.nextLine(); | |
Sinhvien b = new Sinhvien(maSV,tenSV,NgayVao,maPhong); | |
list.add(b); | |
} | |
} | |
public void InTT() { | |
Enumeration eBook = list.elements(); | |
int i=1; | |
while(eBook.hasMoreElements()) { | |
Sinhvien book = (Sinhvien)eBook.nextElement(); | |
System.out.println("Ma SV = "+book.getMaSV()+" va ten Sinh Vien la: "+book.getTenSV()+" co ma phong tro la : "+book.getMaPhong()); | |
} | |
} | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
new QuanLy(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quan ly sinh vien | |
1. Nhap Thong tin | |
2. Xem Bao cao | |
Moi ban chon chuc nang: | |
1 | |
Nhap so luong sinh vien dang ki: | |
1 | |
Nhap thong tin sv thu 1 | |
Nhap ma sinh vien = | |
A12 | |
Nhap ma phong dang ki = | |
B512 | |
Nhap ten sinh vien: | |
Huynh Van Nien | |
Nhap phi o tro/thang : | |
700000 | |
Ngay dang ki: | |
23/8/2018 | |
Quan ly sinh vien | |
1. Nhap Thong tin | |
2. Xem Bao cao | |
Moi ban chon chuc nang: | |
2 | |
Ma SV = A12 va ten Sinh Vien la: Huynh Van Nien co ma phong tro la : B512 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment