Last active
October 21, 2018 11:54
-
-
Save hvnien18it2/a8306dd997f0b00a0c48ffa625da026c to your computer and use it in GitHub Desktop.
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 NhaGiuXe; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Scanner; | |
public class NhapXe { | |
String masoxe; | |
String tenxe; | |
int sl; | |
String Person; | |
float gia; | |
String mavitri; | |
String time; | |
public String getMasoxe() { | |
return masoxe; | |
} | |
public void setMasoxe(String masoxe) { | |
this.masoxe = masoxe; | |
} | |
public String getTenxe() { | |
return tenxe; | |
} | |
public void setTenxe(String tenxe) { | |
this.tenxe = tenxe; | |
} | |
public int getSl() { | |
return sl; | |
} | |
public void setSl(int sl) { | |
this.sl = sl; | |
} | |
public String getTime() { | |
return time; | |
} | |
public void setTime(String time) { | |
this.time = time; | |
} | |
public String getPerSon() { | |
return Person; | |
} | |
public void setPerSon(String Person) { | |
this.Person = Person; | |
} | |
public float getGia() { | |
return gia; | |
} | |
public void setGia(float gia) { | |
this.gia=gia; | |
} | |
public String getVitri() { | |
return mavitri; | |
} | |
public void setVitri(String mavitri) { | |
this.mavitri=mavitri; | |
} | |
public NhapXe() { | |
} | |
public NhapXe(String masoxe,String tenxe,int sl,String Person,float gia,String mavitri,String time) { | |
this.masoxe=masoxe; | |
this.tenxe=tenxe; | |
this.sl=sl; | |
this.Person=Person; | |
this.time=time; | |
this.gia=gia; | |
this.mavitri=mavitri; | |
} | |
} |
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 NhaGiuXe; | |
import java.text.SimpleDateFormat; | |
import java.util.Enumeration; | |
import java.util.Scanner; | |
import java.util.Vector; | |
public class Quanlyxe { | |
Vector list = new Vector(); | |
public Quanlyxe() { | |
while(true) { | |
System.out.println("\n Quan ly xe"); | |
System.out.println("1. Nhap Xe:"); | |
System.out.println("2. Xem thong tin:"); | |
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 xe can dang ki ="); | |
n =Integer.parseInt(key.nextLine()); | |
for(int i=0;i<n;i++) { | |
System.out.println("Nhap xe dang ki thu "+(i+1)); | |
System.out.println("Nhap ma so xe ="); | |
String masoxe=key.nextLine(); | |
System.out.println("Nhap ten xe :"); | |
String tenxe=key.nextLine(); | |
System.out.println("Nhap so luong :"); | |
int sl=Integer.parseInt(key.nextLine()); | |
System.out.println("Ten nguoi so huu xe :"); | |
String Person=key.nextLine(); | |
System.out.println("Thoi gian giu xe :"); | |
String time=key.nextLine(); | |
System.out.println("Nhap gia giu xe :"); | |
float gia=Float.parseFloat(key.nextLine()); | |
System.out.println("Nhap vi tri xe ="); | |
String mavitri=key.nextLine(); | |
NhapXe b = new NhapXe(masoxe,tenxe,sl,Person,gia,mavitri,time); | |
list.add(b); | |
} | |
} | |
public void InTT() { | |
Enumeration xXe = list.elements(); | |
int i=1; | |
while(xXe.hasMoreElements()) { | |
NhapXe Xe = (NhapXe)xXe.nextElement(); | |
System.out.println("Ma so xe ="+Xe.getMasoxe()+" , ten xe la "+Xe.getTenxe()+"\n, ten nguoi so huu la: "+Xe.getPerSon()+" va vi tri xe la: "+Xe.getVitri()); | |
} | |
} | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
new Quanlyxe(); | |
} | |
} |
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 xe | |
1. Nhap Xe: | |
2. Xem thong tin: | |
Moi ban chon chuc nang: | |
1 | |
Nhap so luong xe can dang ki = | |
2 | |
Nhap xe dang ki thu 1 | |
Nhap ma so xe = | |
A11 | |
Nhap ten xe : | |
ABN | |
Nhap so luong : | |
1 | |
Ten nguoi so huu xe : | |
Huynh Van Nien | |
Thoi gian giu xe : | |
100' | |
Nhap gia giu xe : | |
34222 | |
Nhap vi tri xe = | |
S32 | |
Nhap xe dang ki thu 2 | |
Nhap ma so xe = | |
233-k232 | |
Nhap ten xe : | |
GHD | |
Nhap so luong : | |
1 | |
Ten nguoi so huu xe : | |
Nguyen Van A | |
Thoi gian giu xe : | |
32' | |
Nhap gia giu xe : | |
6666 | |
Nhap vi tri xe = | |
C23 | |
Quan ly xe | |
1. Nhap Xe: | |
2. Xem thong tin: | |
Moi ban chon chuc nang: | |
2 | |
Ma so xe =A11 , ten xe la ABN | |
, ten nguoi so huu la: Huynh Van Nien va vi tri xe la: S32 | |
Ma so xe =233-k232 , ten xe la GHD | |
, ten nguoi so huu la: Nguyen Van A va vi tri xe la: C23 | |
Quan ly xe | |
1. Nhap Xe: | |
2. Xem thong tin: | |
Moi ban chon chuc nang: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment