package com.imooc.day10_29;import java.util.*;import java.util.scanner.scanner;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub car[] carsForRent=(new passengerCar("奥迪A4",500,4),new passengerCar("马自达6",400,4),new passengerCar("pickUp6",450,4),new passgerCar("金龙",800,20),new passgerCar("松花江",400, ));System.out.println("欢迎使用哒哒租车系统:");System.out.println("您是否需要租车:1是 0否");scanner scan=new scanner(System.in);String input=scan.next();if(input.equals("1")){ System.out.println("你可租车的类型及其价目表:"); System.out.println("序号\T汽车名称\T租金\T\T容量"); int i=1; for(car currentCar:carsForRent){ if(currentCar instanceof passengerCar){ System.out.println(""+i+"\T"+currentCar.getName()+"\T"+currentCar.get.tent()); } }} }
添加回答
举报
0/150
提交
取消