package muke.stu.one;import java.util.Scanner;import muke.stu.one.entity.Car;import muke.stu.one.entity.Coatch;import muke.stu.one.entity.Pika;import muke.stu.one.entity.Truck;public class rentCar { static Scanner in = new Scanner(System.in); public static void main(String[] args) { Boolean isRentCar = false; int carNum = 0; String rentInformation = null; Car[] carInit = {new Pika("皮卡",2,6,1200), new Truck("大货车",20,800),new Coatch("客车",20,1000),new Pika("破皮卡",3,5,800), new Coatch("破客车",25,1000)}; System.out.println("是否需要租车:1.是 2.否"); int rentCar = in.nextInt(); if(rentCar == 1){ isRentCar = true; } if(isRentCar){ System.out.println("租用几辆车:"); carNum = in.nextInt(); rentInformation = rent(carNum,carInit); System.out.println("您的租车信息:"+"\n"+rentInformation); } System.out.println("谢谢使用"); } //租车界面 public static String rent(int carNum,Car[] carArray){ String rentInformation = null; int carID; double cost =0.0; int people=0; int capacity=0; int days =0; String addPeople =""; String addCapacity=""; //展示车辆信息 System.out.println("序号 \t类型 \t容量 \t价格(元/天)"); for(int i=0;i |