System.out.println("欢迎使用嗒嗒租车系统:");
System.out.println("您是否要租车:y是 否");
Scanner input = new Scanner (System.in);
String answer =input.nextLine();
char answer1 =answer.charAt(0);
if(answer1 == 'y'){
System.out.println("您可租车的类型和价目表");
System.out.println("序号 汽车名称 租金 容量");
Car<String> benz = new Bus ("奔驰","400","1","4");
Car<String> jangling = new Bus ("江铃","300","1","15");
Car<String>sanling = new Truck("三菱","700","1","20");
Car<String> dayun = new Truck ("大运","1000","1","4");
Car<String> hanma = new Pickup ("悍马","400","1","10","4");
Test.pushCar().add(benz);
Test.pushCar().add(jangling );
Test.pushCar().add(sanling);
Test.pushCar().add(dayun);
Test.pushCar().add(hanma);
Iterator it = pushCar().iterator();
while(it.hasNext()){
Object obj = it.next();
System.out.println(obj.toString());
}
}else{
System.out.println("欢迎您再次光临");
}
添加回答
举报
0/150
提交
取消