-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheMuon.java
57 lines (56 loc) · 1.34 KB
/
TheMuon.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
package Baithuchanhso3;
import java.util.Scanner;
class SinhVien{
String hoten;
String lop;
int namsinh;
public void nhapTT()
{
Scanner sc = new Scanner(System.in);
System.out.println("Nhap ho ten: ");
hoten = sc.nextLine();
System.out.println("Nhap lop: ");
lop = sc.nextLine();
System.out.println("Nhap nam sinh: ");
namsinh = sc.nextInt();
}
public void inTT()
{
System.out.println("ho ten: " + hoten);
System.out.println("lop: " + lop);
System.out.println("nam sinh: " + namsinh);
}
}
public class TheMuon {
String sophieumuon;
String ngaymuon;
String hantra;
String solieu;
SinhVien sv = new SinhVien();
public void nhapTT()
{
Scanner sc = new Scanner(System.in);
System.out.println("so phieu muon: ");
sophieumuon = sc.nextLine();
System.out.println("ngay muon: ");
ngaymuon = sc.nextLine();
System.out.println("han tra: ");
hantra = sc.nextLine();
System.out.println("so lieu: ");
solieu = sc.nextLine();
sv.nhapTT();
}
public void inTT()
{
System.out.println("so phieu muon: " + sophieumuon);
System.out.println("ngay muon: " + ngaymuon);
System.out.println("han tra: " + hantra);
System.out.println("so lieu: " + solieu);
sv.inTT();
}
public static void main(String[] args) {
TheMuon tm = new TheMuon();
tm.nhapTT();
tm.inTT();
}
}