首页 > IT职业 > IT生活 > imooc中java基础第二季的项目实站实现代码
package cn.form1;
import java.util.Scanner;
//import java.util.Arrays;
public class Runmain {
private static Scanner scanner;
public static void main(String[] args) {
int isrental = 0;
int carcount = 0;
int cardays = 0;
int car_total = 0;
String strs = "";
scanner = new Scanner(System.in);
System.out.println("欢迎使用租车系统:");
System.out.println("您是否要租车?1是、0否");
isrental = scanner.nextInt();
if(isrental == 0){
System.out.println("欢迎下次光临!!!");
}else if(isrental == 1){
Car[] arrcar = new Car[3];
arrcar[0] = new Aodi(1,"奥迪",600,5);
arrcar[1] = new Pika(2,"皮卡",300,3,2);
arrcar[2] = new Sohujang(3,"花江",200,5);
System.out.println("可租车的类型与价格表:");
System.out.println("序号 名称 租金 容量");
for(int i = 0; i arrcar.length){
System.out.println("超出可租车数量");
}else{
for(int i = 0; i 来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1273/viewspace-2807828/ ,如需转载,请注明出处,否则将追究法律责任。