第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

大神幫忙看看還有什么需要改進(jìn),thanks

package?com.dadazuche2;

public?class?Car?{
	int?id;
	String?carName;
	float?pay;
????int?setNum;
????int?loadNum;
????static?String?lieXing;
	public?Car(int?id,String?carName,String?lieXing,int?setNum,int?loadNum,float?pay){
		this.id=id;
		this.carName=carName;
		this.pay=pay;
		this.setNum=setNum;
		this.loadNum=loadNum;
}
	public?Car(int?id2,?String?carName2,?int?setNum2,?int?loadNum2,?float?pay2)?{
		//?TODO?Auto-generated?constructor?stub
	}
	public?int?getId()?{
		return?id;
	}
	public?void?setId(int?id)?{
		this.id?=?id;
	}
	public?String?getCarName()?{
		return?carName;
	}
	public?void?setCarName(String?carName)?{
		this.carName?=?carName;
	}
	public?float?getPay()?{
		return?pay;
	}
	public?void?setPay(float?pay)?{
		this.pay?=?pay;
	}
	public?int?getSetNum()?{
		return?setNum;
	}
	public?void?setSetNum(int?setNum)?{
		this.setNum?=?setNum;
	}
	public?int?getLoadNum()?{
		return?loadNum;
	}
	public?void?setLoadNum(int?loadNum)?{
		this.loadNum?=?loadNum;
	}
	public?void?infoshow()?{
	}
}

package com.dadazuche2;


public class KeChe extends Car {

public final String leiXing="客車(chē)";

public KeChe(int id, String carName, String lieXing,int setNum,int loadNum, float pay) {

super(id, carName, lieXing,setNum,loadNum, pay);

}

public void infoshow() {

System.out.println(id+"\t\t"+carName+"\t\t"+leiXing+"\t\t"+setNum+"人"+"\t\t\t\t"+pay+"元/天");

}

}

package com.dadazuche2;


public class HuoChe extends Car {

public final String leiXing="貨車(chē)";

public HuoChe(int id, String carName, String lieXing,int setNum, int loadNum, float pay) {

super(id, carName,lieXing,setNum, loadNum, pay);

}

public void infoshow() {

System.out.println(id+"\t\t"+carName+"\t\t"+leiXing+"\t\t"+loadNum+"噸"+"\t\t\t\t"+pay+"元/天");

}

}

package com.dadazuche2;


public class PkChe extends Car {

public final String leiXing="皮卡";

public PkChe(int id, String carName, String lieXing, int setNum, int loadNum, float pay) {

super(id, carName,lieXing, setNum, loadNum, pay);

}

public void infoshow() {

System.out.println(id+"\t\t"+carName+"\t\t"+leiXing+"\t\t"+loadNum+"噸"+"\t\t"+setNum+"人"+"\t\t"+pay+"元/天");

}

}

package com.dadazuche2;

import java.util.Scanner;



public class Inner {


private static Scanner input;


public static void main(String[] args) {

float sum=0;

Car[] car={new KeChe(1,"奧迪A6","客車(chē)",5,0,200),new KeChe(2,"保時(shí)捷A6L","客車(chē)",5,0,200),

new HuoChe(3,"依維柯","貨車(chē)",0,10,400),new PkChe(4,"金龍","皮卡",8,3,400)};

input = new Scanner(System.in);

System.out.println("***************歡迎來(lái)到dada租車(chē)系統(tǒng)***************");

System.out.println("是否真的租車(chē)?是1否0 請(qǐng)輸入:");

int userIn=input.nextInt();

if(userIn==1){

System.out.println("租車(chē)信息列表如下:");

System.out.println("車(chē)牌號(hào):"+"\t\t"+"車(chē)名字:"+"\t\t"+"車(chē)型:"+"\t\t"+"載貨量(座位數(shù)):"+"\t\t\t"+"價(jià)錢(qián):");

for(int i=0;i<car.length;i++){

car[i].infoshow();

}

System.out.println("請(qǐng)輸入車(chē)輛數(shù)");

? ? ? ? int carNum=input.nextInt();

int[] carId=new int[100];

? ? ? ? System.out.println("請(qǐng)輸入車(chē)號(hào)");

? ? ? ? for(int i=0;i<car.length;i++){

? ? ? ? carId[i]=input.nextInt();

? ? ? ? }

? ? ? ? System.out.println("請(qǐng)輸入使用天數(shù)");

? ? ? ? int day=input.nextInt();

? ? ? ? System.out.println("您的訂單信息如下:");

? ? ? ? System.out.println("車(chē)牌號(hào):"+"\t\t"+"車(chē)名字:"+"\t\t"+"車(chē)型:"+"\t\t"+"載貨量(座位數(shù)):"+"\t\t\t"+"價(jià)錢(qián):");

? ? ? ? for(int i=0;i<car.length;i++){

? ? ? ? for(int j=0;j<car.length;j++){

? ? ? ? if(car[j].getId()==carId[i]){

? ? ? ? car[j].infoshow();

? ? ? ? sum= sum+car[j].getPay();

? ? ? ? }

? ? ? ?

? ? ? ?

? ? ? ? }

? ? ? ? }

? ? ? ? System.out.println(sum);

? ? ? ? System.out.println("用車(chē)輛數(shù)"+carNum+"用車(chē)天數(shù)"+day);

? ? ? ? System.out.println("總費(fèi)用:"+sum*day);

? }else{

? ? System.out.println("歡迎下次光臨dada租車(chē)系統(tǒng)!");

?

}

}

}


正在回答

1 回答

System.out.println("請(qǐng)輸入車(chē)號(hào)");

? ? ? ? for(int i=0;i<car.length;i++)

這里的i<car.length,是不是應(yīng)該改為i<carNum更好些呢?

用戶(hù)輸入車(chē)輛數(shù)之后,選擇車(chē)號(hào)的數(shù)量應(yīng)該和車(chē)輛數(shù)一致吧

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

大神幫忙看看還有什么需要改進(jìn),thanks

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)