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

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

請(qǐng)大神給出改進(jìn)意見,不勝感激

父類

package?com.zuche;

public??class?CarProperty?{
	public?String?carP1;//車輛名稱
	public??String?carP2;?//車輛類型
	?public?int?carP3;//載客量
?????public??int?carP4;//載貨量
?????public?int?carP5;?//租金每天
??????
?????public?CarProperty(String?newcarP1,String?newcarP2,
????		?int?newcarP3,int?newcarP4,int?newcarP5)?{
????	?carP1=newcarP1;
????	?carP2=newcarP2;
????	?carP3=newcarP3;
????	?carP4=newcarP4;
????	?carP5=newcarP5;???	
?????}

}

子類

package?com.zuche;

public?class?HuoChe?extends?CarProperty?{

	public?HuoChe(String?newcarP1,?String?newcarP2,?int?newcarP3,?int?newcarP4,?int?newcarP5)?{
		super(newcarP1,?newcarP2,?newcarP3,?newcarP4,?newcarP5);
		//?TODO?Auto-generated?constructor?stub
	}

	@Override
	public?String?toString()?{
		return?carP1?+?"?????????"?+?carP2?+?"????????????"?+?carP3?+?"????????"?+?carP4?+?"?????"
				+?carP5?;
	}

}
package?com.zuche;

public?class?KeChe?extends?CarProperty?{

	public?KeChe(String?newcarP1,?String?newcarP2,?int?newcarP3,?int?newcarP4,?int?newcarP5)?{
		super(newcarP1,?newcarP2,?newcarP3,?newcarP4,?newcarP5);
		//?TODO?Auto-generated?constructor?stub
	}
	public?String?toString()?{
		return?carP1?+?"?????????"?+?carP2?+?"????????????"?+?carP3?+?"????????"?+?carP4?+?"?????"
				+?carP5?;
	}

}
package?com.zuche;

public?class?PiKa?extends?CarProperty?{

	public?PiKa(String?newcarP1,?String?newcarP2,?int?newcarP3,?int?newcarP4,?int?newcarP5)?{
		super(newcarP1,?newcarP2,?newcarP3,?newcarP4,?newcarP5);
		//?TODO?Auto-generated?constructor?stub
	}
	public?String?toString()?{
		return?carP1?+?"?????????"?+?carP2?+?"????????????"?+?carP3?+?"????????"?+?carP4?+?"?????"
				+?carP5?;
	}
}

測(cè)試

package?com.zuche;
import?java.util.*;
public?class?Initial?{

	public?static?void?main(String[]?args)?{
		//?TODO?Auto-generated?method?stub
	CarProperty?huo1=new?HuoChe("1,奧迪",?"貨車",?2,?3,?100);
	CarProperty?huo2=new?HuoChe("2,奧拓",?"貨車",?2,?2,?80);
	?CarProperty?ke1=new?KeChe("3,寶馬",?"客車",?4,?0,?150);
	?CarProperty?ke2=new?KeChe("4,一汽",?"客車",?4,?0,?100);
?????CarProperty?pi1=new?PiKa("5,五菱",?"兩用",?8,?2,?80);
?????CarProperty?pi2=new?PiKa("6,奔馬",?"兩用",?2,?3,?60);
?????????int??sum=0;
		int?i3=0;
????System.out.println("請(qǐng)您選擇是否租車?");
????System.out.println("1,是????2,否");
????Scanner?input1=new?Scanner(System.in);
??????int?i1=input1.nextInt();
????if(i1==1)?{
????	System.out.println("車輛名稱???車輛類型???載客量/人???載貨量/噸???租金/每天");
????	System.out.println(huo1.toString());
????	System.out.println(huo2.toString());
????	System.out.println(ke1.toString());
????	System.out.println(ke2.toString());
????	System.out.println(pi1.toString());
????	System.out.println(pi2.toString());
???System.out.println("請(qǐng)您選擇租車數(shù)量:");
????	Scanner?input2=new?Scanner(System.in);
????	??int?i2=input2.nextInt();
????	??for(int?i=1;i<i2+1;i++)?{
????		??System.out.println("請(qǐng)輸入您要租用的第"+i+"輛車的編號(hào)");
????		??Scanner?input3=new?Scanner(System.in);
????		????i3=input3.nextInt();
????		??switch(i3)?{
????		??case?1:
????			??sum=sum+100;
????			??break;
????		??case?2:
????			??sum=sum+20;
????			??break;
????		??case?3:
????			??sum=sum+150;
????			??break;
????		??case?4:
????			??sum=sum+100;
????			??break;
????		??case?5:
????			??sum=sum+80;
????			??break;
????		??case?6:
????			??sum=sum+60;
????			??break;
????			??default:
????				??System.out.println("您輸入的編號(hào)是無效的!");
????		??
????		??}if(i3<0||i3>6)
????			??break;
????			??}if(i3>0&&i3<7)?{
????	???System.out.println("請(qǐng)輸入租用的天數(shù)");
????	??Scanner?input4=new?Scanner(System.in);
????	??int?sum1=input4.nextInt();
????	??sum=sum*sum1;
????	??System.out.println("總共租車:"+i2+"輛,租用:"+sum1+"天,共需:"+sum+"元人民幣。");
????	??}else?{
????		??System.out.println("請(qǐng)重新操作!");
????	??}?}else?{
????	System.out.println("感謝使用該系統(tǒng)!");
????}
????
	}

}


正在回答

5 回答

package?com.zuche;

import?java.util.*;

public?class?Initial?{

?

????public?static?void?main(String[]?args)?{

????????//?TODO?Auto-generated?method?stub

????CarProperty?huo1=new?HuoChe("1,奧迪",?"貨車",?2,?3,?100);

????CarProperty?huo2=new?HuoChe("2,奧拓",?"貨車",?2,?2,?80);

?????CarProperty?ke1=new?KeChe("3,寶馬",?"客車",?4,?0,?150);

?????CarProperty?ke2=new?KeChe("4,一汽",?"客車",?4,?0,?100);

?????CarProperty?pi1=new?PiKa("5,五菱",?"兩用",?8,?2,?80);

?????CarProperty?pi2=new?PiKa("6,奔馬",?"兩用",?2,?3,?60);

?????????

int ?sum=0;


? ? ? ?int i3=0;


? ?System.out.println("請(qǐng)您選擇是否租車?");


? ?System.out.println("1,是 ? ?2,否");


? ?Scanner input1=new Scanner(System.in);


? ? ?int i1=input1.nextInt();


? ?if(i1==1) {


? ? ? ?System.out.println("車輛名稱 ? 車輛類型 ? 載客量/人 ? 載貨量/噸 ? 租金/每天");


? ? ? ?/*System.out.println(huo1.toString());


? ? ? ?System.out.println(huo2.toString());


? ? ? ?System.out.println(ke1.toString());


? ? ? ?System.out.println(ke2.toString());


? ? ? ?System.out.println(pi1.toString());


? ? ? ?System.out.println(pi2.toString());

*/

??


? ? ? ? ? ? ?System.out.println("請(qǐng)輸入您要租用輛車的編號(hào)");


? ? ? ? ? ? ?Scanner input3=new Scanner(System.in);


? ? ? ? ? ? ? ?i3=input3.nextInt();


? ? ? ? ? ? ?switch(i3) {


? ? ? ? ? ? ?case 1:


? ? ? ? ? ? ? ? ?sum=sum+100;


? ? ? ? ? ? ? ? ?break;


? ? ? ? ? ? ?case 2:


? ? ? ? ? ? ? ? ?sum=sum+20;


? ? ? ? ? ? ? ? ?break;


? ? ? ? ? ? ?case 3:


? ? ? ? ? ? ? ? ?sum=sum+150;


? ? ? ? ? ? ? ? ?break;


? ? ? ? ? ? ?case 4:


? ? ? ? ? ? ? ? ?sum=sum+100;


? ? ? ? ? ? ? ? ?break;


? ? ? ? ? ? ?case 5:


? ? ? ? ? ? ? ? ?sum=sum+80;


? ? ? ? ? ? ? ? ?break;


? ? ? ? ? ? ?case 6:


? ? ? ? ? ? ? ? ?sum=sum+60;


? ? ? ? ? ? ? ? ?break;


? ? ? ? ? ? ? ? ?default:


? ? ? ? ? ? ? ? ? ? ?System.out.println("您輸入的編號(hào)是無效的!");?


? ? ? ? ? ? }


? ? ? ? ? ? ? ? ? if(i3<0||i3>6){

? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? }else if(3>0&&i3<7){


? ? ? ? ? ? ? ? ? ? ? ?System.out.println("請(qǐng)您選擇租車數(shù)量:");


? ? ? ? ? ? ? ? ? ? ? ?Scanner input2=new Scanner(System.in);


? ? ? ? ? ? ? ? ? ? ? ?int i2=input2.nextInt();


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


? ? ? ? ? ? ? ? ? ? Scanner input4=new Scanner(System.in);


? ? ? ? ? ? ? ? ? ? int sum1=input4.nextInt();


? ? ? ? ? ? ? ? ? ? sum=sum*sum1*i2;


? ? ? ? ? ? ? ? ? ?}else {

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ?System.out.println("請(qǐng)重新操作!");

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ?}?


? ?}else {


? ? ? ?System.out.println("感謝使用該系統(tǒng)!");


? ?}

}



}


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

long_l 提問者

非常感謝!
2017-07-19 回復(fù) 有任何疑惑可以回復(fù)我~
#2

long_l 提問者

我沒看懂你改了什么,能講下嗎?
2017-07-19 回復(fù) 有任何疑惑可以回復(fù)我~

i3保證大于0就行了吧,不用&&i3<7,應(yīng)該允許重復(fù)租用車輛的

個(gè)人見解

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

很不錯(cuò)了

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

System.out.println("請(qǐng)您選擇租車數(shù)量:");

????????Scanner?input2=new?Scanner(System.in);

??????????int?i2=input2.nextInt();

放到了

else if(3>0&&i3<7){

}

里面 ?

-------------------------------------------------------------------

????sum=sum*sum1

改成?

????sum=sum*sum1*i2;

--------------------------------------------------------------------

for(int?i=1;i<i2+1;i++)?{ 這行刪除

??????????????System.out.println("請(qǐng)輸入您要租用的第"+i+"輛車的編號(hào)");

這個(gè)改成

?????????????System.out.println("請(qǐng)輸入您要租用輛車的編號(hào)");


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

long_l 提問者

謝謝,我試試
2017-07-19 回復(fù) 有任何疑惑可以回復(fù)我~
#2

long_l 提問者

你這個(gè)是同種型號(hào)的車可以選擇租用的天數(shù)和數(shù)量,比我原來的更適合實(shí)際業(yè)務(wù)需要,謝謝了
2017-07-19 回復(fù) 有任何疑惑可以回復(fù)我~

666

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

舉報(bào)

0/150
提交
取消

請(qǐng)大神給出改進(jìn)意見,不勝感激

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

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

幫助反饋 APP下載

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

公眾號(hào)

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