-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBienLai.java
70 lines (69 loc) · 1.75 KB
/
BienLai.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
package Baithuchanhso3;
import java.util.*;
class KhachHang{
String hoTen;
String soNha;
String macongto;
public void nhapTT() {
Scanner sc = new Scanner(System.in);
System.out.println("Nhap ho ten: ");
hoTen = sc.nextLine();
System.out.println("Nhap so nha: ");
soNha = sc.nextLine();
System.out.println("Nhap ma cong to: ");
macongto = sc.nextLine();
}
public void inTT() {
System.out.println("Ho ten: " + hoTen);
System.out.println("So nha: " + soNha);
System.out.println("Ma cong to: " + macongto);
}
}
class BienLai1{
KhachHang kh = new KhachHang();
int chisocu;
int chisomoi;
int soTien;
public void nhap() {
Scanner sc = new Scanner(System.in);
System.out.println("Nhap chi so cu: ");
chisocu = sc.nextInt();
System.out.println("Nhap chi so moi: ");
chisomoi = sc.nextInt();
kh.nhapTT();
}
public void hienthi() {
System.out.println("Chi so cu: " + chisocu);
System.out.println("Chi so moi: " + chisomoi);
System.out.println("So tien: " + (chisomoi-chisocu)*850000);
kh.inTT();
}
}
public class BienLai{
int n;
BienLai1 Mang[];
public void nhapMang() {
Scanner sc = new Scanner(System.in);
System.out.println("Nhap so ho dan : ");
n = sc.nextInt();
Mang= new BienLai1[n];
for(int i=0; i<n;i++) {
System.out.println("Nhap thong tin cho ho dan thu: " + (i+1));{
Mang[i] = new BienLai1();
Mang[i].nhap();
}
}
}
public void htmang() {
System.out.println(".................Hien thi..............");
for(int i=0; i<n; i++) {
System.out.println("Thong tin cho ho dan thu: " + (i+1));
Mang[i].hienthi();
}
}
public static void main(String[] args) {
BienLai ql = new BienLai();
ql.nhapMang();
ql.htmang();
}
}