package good.tianmg_optimise;public class AutoCar { private String name; private int price; private int capacity; private int car_no; private int capacity_g; public AutoCar(int no,String name,int price,int capacity){ this.car_no = no; this.name = name; this.price = price; this.capacity = capacity; } public AutoCar(int no,String name,int price,int capacity_p,int capacity_g){ this.car_no = no; this.name = name; this.price = price; this.capacity = capacity; this.capacity_g = capacity_g; } public int getCar_no() { return car_no; } public void setCar_no(int car_no) { this.car_no = car_no; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public void setcapacity(int carry) { this.capacity = carry; } public int getcapacity() { return capacity; } public int getcapacity_g(){ return capacity_g; }}package good.tianmg_optimise;import java.util.*;import java.util.List;public class Main { public static void main(String[] args) { // write your code here AutoCar audi = new AutoCar(1, "奥迪A4", 500, 4); AutoCar mazida = new AutoCar(2, "马自达6", 400, 4); AutoCar pika = new AutoCar(3, "皮卡雪6", 450, 4, 2); AutoCar jinlong = new AutoCar(4, "金龙", 800, 20); AutoCar songfajiang = new AutoCar(5, "松花江", 400, 4); AutoCar yiweike = new AutoCar(6, "依维柯", 1000, 20); Scanner input = new Scanner(System.in); System.out.println("欢迎使用答答租车系统:" + "\n" + "您是否要租车:1是 0否"); int input_whethear = input.nextInt(); if (input_whethear == 1) { System.out.println("你可租车的类型及其价目表:"); System.out.println("序号 " + "汽车名称 " + "租金 " + "容量 "+ "\n" +audi.getCar_no() + "." + " " + audi.getName() + " " + audi.getPrice() + "元/天" + " " + "载人:" + audi.getcapacity() + "人"+ "\n"+ +mazida.getCar_no() + "." + " " + mazida.getName() + " " + mazida.getPrice() + "元/天" + " " + "载人:" + mazida.getcapacity() + "人"+ "\n" +pika.getCar_no() + "." + " " + pika.getName() + " " + pika.getPrice() + "元/天" + " " + "载人:" + pika.getcapacity() + "人" + "载货:" + pika.getcapacity_g() + "吨"+ "\n" +jinlong.getCar_no() + "." + " " + jinlong.getName() + " " + jinlong.getPrice() + "元/天" + " " + "载人:" + jinlong.getcapacity() + "人"+ "\n" +songfajiang.getCar_no() + "." + " " + songfajiang.getName() + " " + songfajiang.getPrice() + "元/天" + " " + "载货:" + songfajiang.getcapacity_g() + "吨"+ "\n" +yiweike.getCar_no() + "." + " " + yiweike.getName() + " " + yiweike.getPrice() + "元/天" + " " + "载货:" + yiweike.getcapacity_g() + "吨"); System.out.println("请输入您要租汽车的数量:"); int AutoCar_number = input.nextInt(); int[] AutoCar_no = new int[AutoCar_number]; //List listCar = new ArrayList(); for(int i=0;i |