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

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

代碼流程有問(wèn)題,請(qǐng)大佬幫忙指點(diǎn)一下

package?com.exc;import?java.util.Scanner;public?class?DDRental?{	public?static?void?main(String[]?args)?{		int?money?=0;		Car[]?carForRentCars?=?{new?AutoCar("奧迪",?500,?4),?new?AutoCar("馬自達(dá)",?400,?4),?				new?AutoCar("金龍",?800,?20)?,new?Trunk("松花江",?400,?4),?				new?Trunk("依維柯",?1000,?20),?new?PickCar("皮卡",?450,?2,?4)};			System.out.println("歡迎使用噠噠租車系統(tǒng)~~~");		System.out.println("您是否要租車:1是???2否");		Scanner?sc?=?new?Scanner(System.in);				boolean?flag?=?true;		while?(flag)?{			int?rent?=?sc.nextInt();			switch?(rent)?{			case?1:				System.out.println("您可租車的類型及其價(jià)格表如下:");				System.out.println("序號(hào)\t汽車名稱\t租金\t\t容量");								for?(int?i?=?0;?i?<?carForRentCars.length;?i++)?{					if?(carForRentCars[i]?instanceof?AutoCar)?{						AutoCar?aCar?=?(AutoCar)?carForRentCars[i];						System.out.println((i+1)?+?"\t"?+?aCar.name?+"\t"?+?aCar.rent?+?"元/天\t\t載人:"?+?aCar.getPeopleCapacity()?+"人");					}?else?if?(carForRentCars[i]?instanceof?Trunk)?{						Trunk?trunk?=?(Trunk)?carForRentCars[i];						System.out.println((i+1)?+?"\t"?+?trunk.name?+"\t"?+?trunk.rent?+?"元/天\t\t載人:"?+?trunk.getCargoCapacity()?+"人");					}?else?if?(carForRentCars[i]?instanceof?PickCar)?{						PickCar?pCar?=?(PickCar)?carForRentCars[i];						System.out.println((i+1)?+?"\t"?+?pCar.name?+"\t"?+?pCar.rent?+?"元/天\t\t載人:"?+??pCar.getPeopleCapacity()?+?								"人???載貨:"+?pCar.getCargoCapacity()?+"噸");					}				}				flag?=?false;				break;			case?2:				System.out.println("感謝您的光臨,期待下次與您再見(jiàn),祝您生活愉快!");				flag?=?false;				break;			default:				System.out.println("您好,您的輸入不正確。請(qǐng)根據(jù)提示正確輸入!");				break;			}		}				System.out.println("請(qǐng)輸入您要租車的數(shù)量:");		int?count?=?sc.nextInt();		for?(int?i?=?1;?i?<=?count;?i++)?{			System.out.println("請(qǐng)輸入第"?+?i?+"輛車的序號(hào):");			int?id?=?sc.nextInt();			switch?(id)?{			case?1:				money?+=?carForRentCars[0].getRent();				break;			case?2:				money?+=?carForRentCars[1].getRent();				break;			case?3:				money?+=?carForRentCars[2].getRent();				break;			case?4:				money?+=?carForRentCars[3].getRent();				break;			case?5:				money?+=?carForRentCars[4].getRent();				break;			case?6:				money?+=?carForRentCars[5].getRent();				break;			default:				break;			}		}				System.out.println("請(qǐng)輸入租車天數(shù):");		int?day?=?sc.nextInt();		System.out.println("您的帳單:"?+?day*money?+?"元?。?!");	}}class?Car{	String?name;	int?rent;	public?Car()?{}		public?String?getName()?{		return?name;	}	public?void?setName(String?name)?{		this.name?=?name;	}	public?double?getRent()?{		return?rent;	}	public?void?setRent(int?rent)?{		this.rent?=?rent;	}		}class?AutoCar?extends?Car{	private?int?peopleCapacity;		public?AutoCar()?{}	public?AutoCar(String?name,?int?rent,?int?peopleCapacity)?{		this.name?=?name;		this.rent?=?rent;		this.peopleCapacity?=?peopleCapacity;	}	public?int?getPeopleCapacity()?{		return?peopleCapacity;	}	public?void?setPeopleCapacity(int?peopleCapacity)?{		this.peopleCapacity?=?peopleCapacity;	}	}class?Trunk?extends?Car{	private?int?cargoCapacity;		public?Trunk()?{}	public?Trunk(String?name,?int?rent,?int?cargoCapacity)?{		this.name?=?name;		this.rent?=?rent;		this.cargoCapacity?=?cargoCapacity;	}	public?int?getCargoCapacity()?{		return?cargoCapacity;	}	public?void?setCargoCapacity(int?cargoCapacity)?{		this.cargoCapacity?=?cargoCapacity;	}	}class?PickCar?extends?Car{	private?int?cargoCapacity;	private?int?peopleCapacity;		public?PickCar()?{}	public?PickCar(String?name,?int?rent,?int?cargoCapacity,?int?peopleCapacity)?{		this.name?=?name;		this.rent?=?rent;		this.cargoCapacity?=?cargoCapacity;		this.peopleCapacity?=?peopleCapacity;	}	public?int?getCargoCapacity()?{		return?cargoCapacity;	}	public?void?setCargoCapacity(int?cargoCapacity)?{		this.cargoCapacity?=?cargoCapacity;	}	public?int?getPeopleCapacity()?{		return?peopleCapacity;	}	public?void?setPeopleCapacity(int?peopleCapacity)?{		this.peopleCapacity?=?peopleCapacity;	}	}


正在回答

2 回答

看到我想給你一耳巴子 哈哈


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

對(duì)不起各位,格式亂了,這個(gè)問(wèn)題就當(dāng)我沒(méi)發(fā)布過(guò)

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

舉報(bào)

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

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

進(jìn)入課程

代碼流程有問(wèn)題,請(qǐng)大佬幫忙指點(diǎn)一下

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

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

幫助反饋 APP下載

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

公眾號(hào)

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