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

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

2018/12/12 提交作業(yè)

package?com.imooc.car;
import?java.util.Scanner;
public?class?Main?{	

????static?Che?che[]?=?{		
????????new?Car("奧迪A4",?500,?4),		
????????new?Car("馬自達(dá)6",?400,?4),		
????????new?CarAndTruck("皮卡雪6",?450,?4,?2),		
????????new?Car("金龍",?800,?20),		
????????new?Truck("松花江",?400,?4),		
????????new?Truck("依維柯",?1000,?20)	};
????????	
????static?void?tip()?{		
????????System.out.println("歡迎使用滴答租車(chē)系統(tǒng):");		
????????System.out.println("您是否要租車(chē):1是??0否");		
????????System.out.println();	
????}		
????
????public?static?void?main(String[]?args)?{				
????????Scanner?sc?=?new?Scanner(System.in);		
????????Main.tip();		
????????int?cheSum?=?0;		
????????int?cheMoney?=?0;		
????????int?cheTon?=?0;		
????????int?cheDay?=?0;		
????????int?sumPeople?=?0;				
????????while?(sc.nextInt()?==?1)?{			
????????????Main.tip();			
????????????int?index?=?1;			
????????????System.out.println("序號(hào)\t汽車(chē)名稱(chēng)\t租金\t\t容量");			
????????????for?(Che?item?:?Main.che)?{				
????????????????System.out.print((index++)?+?".");				
????????????????item.print();			
????????????}						
????????????
????????????System.out.println("請(qǐng)輸入您要租汽車(chē)的數(shù)量:");			
????????????cheSum?=?sc.nextInt();			
????????????int[]?cheData?=?new?int[cheSum];						
????????????for?(int?i?=?1;?i?<=?cheSum;?i++)?{				
????????????????System.out.println("請(qǐng)輸入第"?+?i?+?"輛車(chē)的序號(hào):");				
????????????????cheData[i?-?1]?=?sc.nextInt()?-?1;			
????????????}						
????????????
????????????System.out.println("請(qǐng)輸入租車(chē)天數(shù):");			
????????????cheDay?=?sc.nextInt();			
????????????String?strPeople?=?"";			
????????????String?strCaipcty?=?"";			
????????????System.out.println("您的賬單:");			
????????????for?(int?item?:?cheData)?{				
????????????????sumPeople?+=?Main.che[item].getPeople();				
????????????????cheMoney?+=?Main.che[item].getMoney();				
????????????????cheTon?+=?Main.che[item].getCapcity();				
????????????????if?(Main.che[item].getPeople()?!=?0)?{					
????????????????????strPeople?+=?Main.che[item].getName()?+?"\t";				
????????????????}				
????????????????if?(Main.che[item].getCapcity()?!=?0)?{					
????????????????????strCaipcty?+=?Main.che[item].getName()?+?"\t";				
????????????????}			
????????????}						
????????????System.out.println("***可載人的車(chē)有:");			
????????????System.out.print(strPeople);			
????????????System.out.print("???共載人:"?+?sumPeople);			
????????????System.out.println();			
????????????System.out.println("***可載貨的車(chē)有:");			
????????????System.out.print(strCaipcty);			
????????????System.out.print("???共載貨:"?+?cheTon);			
????????????System.out.println();			
????????????System.out.println("***租車(chē)總價(jià)格:"?+?cheMoney?*?cheDay);			
????????????System.out.println();			
????????????System.out.println("是否繼續(xù)租車(chē):1是??0否");		
????????}				
????????sc.close();	
????}
}


正在回答

1 回答

666

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

舉報(bào)

0/150
提交
取消
Java入門(mén)第二季 升級(jí)版
  • 參與學(xué)習(xí)       531100    人
  • 解答問(wèn)題       6280    個(gè)

課程升級(jí)!以終為始告別枯燥,在開(kāi)發(fā)和重構(gòu)中體會(huì)Java面向?qū)ο缶幊痰膴W妙

進(jìn)入課程

2018/12/12 提交作業(yè)

我要回答 關(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)