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

為了賬號安全,請及時綁定郵箱和手機立即綁定

純小白,沒有用大神的一些方法(看了也不懂),也沒有封裝,希望提一些意見

package com.imooc;

public abstract class Car {
?? ?public abstract void showMessageAll();{
?? ??? ?
?? ?}
}

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

package com.imooc;

public class AutoCar extends Car {
?? ?String Auto1="奧迪";
?? ?int AM1=500;
?? ?int AP=4;
?? ?String Auto2="馬自達";
?? ?int AM2=400;
?? ?String Auto3="金龍";
?? ?int AM3=800;
?? ?int AP2=20;
?? ?
?? ?

?? ?@Override
?? ?public void showMessageAll() {
?? ??? ?// TODO Auto-generated method stub
?? ??? ?System.out.println("1.?? "+Auto1+"?? "+AM1+"元/天???? 載客量"+AP+"人");
?? ??? ?System.out.println("2.?? "+Auto2+"?? "+AM2+"元/天???? 載客量"+AP+"人");
?? ??? ?System.out.println("3.?? "+Auto3+"?? "+AM3+"元/天???? 載客量"+AP2+"人");
?? ?

?? ?}
?? ?public void showMessage1()
?? ?{
?? ??? ?System.out.println("1.?? "+Auto1+"?? "+AM1+"元/天???? 載客量"+AP+"人");
?? ??? ?
?? ??? ?
?? ?}
?? ?public void showMessage2()
?? ?{
?? ??? ?System.out.println("2.?? "+Auto2+"?? "+AM2+"元/天???? 載客量"+AP+"人");
?? ?}
?? ?public void showMessage3()
?? ?{
?? ??? ?System.out.println("3.?? "+Auto3+"?? "+AM3+"元/天???? 載客量"+AP2+"人");
?? ?}

}

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

package com.imooc;

public class Track extends Car {
?? ?String track1="松花江";
?? ?int tm1=400;
?? ?int tg1=4;
?? ?String track2="依維柯";
?? ?int tm2=1000;
?? ?int tg2=20;

?? ?@Override
?? ?public void showMessageAll() {
?? ??? ?// TODO Auto-generated method stub
?? ??? ?System.out.println("4.?? "+track1+"?? "+tm1+"元/天???? 載貨量"+tg1+"噸");
?? ??? ?System.out.println("5.?? "+track2+"?? "+tm2+"元/天???? 載貨量"+tg2+"噸");

?? ?}
?? ?public void showMessage1()
?? ?{
?? ??? ?System.out.println("4.?? "+track1+"?? "+tm1+"元/天???? 載貨量"+tg1+"噸");
?? ?}
?? ?public void showMessage2()
?? ?{
?? ??? ?System.out.println("5.?? "+track2+"?? "+tm2+"元/天???? 載貨量"+tg2+"噸");
?? ?}
?

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

package com.imooc;

public class Special extends Car {
?? ?String specialName1="皮卡雪";
?? ?int sm1=450;
?? ?int sp1=4;
?? ?int sg1=2;

?? ?@Override
?? ?public void showMessageAll() {
?? ??? ?// TODO Auto-generated method stub
?? ??? ?System.out.println("6.?? "+specialName1+"?? "+sm1+"元/天???? 載人量"+sp1+"人? 載貨量"+sg1+"噸");

?? ?}
?? ?public void showMessage1()
?? ?{
?? ??? ?System.out.println("6.?? "+specialName1+"?? "+sm1+"元/天???? 載人量"+sp1+"人? 載貨量"+sg1+"噸");
?? ?}

}


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

package com.imooc;
import java.util.Scanner;

public class ZuChe {
?? ?
?? ?
?? ?public void show(){???????? //顯示租車信息
?? ??? ?System.out.println("您可租車的類型和項目表");
?? ??? ?System.out.println("num? name? money? peoplenum");
?? ??? ?}
?? ?
?? ?

?? ?public static void main(String[] args) {
?? ??? ?Scanner scanner = new Scanner(System.in);
?? ??? ?Car auto1=new AutoCar();
?? ??? ?Car track1=new Track();
?? ??? ?Car special1=new Special();
?? ??? ?ZuChe show1=new ZuChe();
?? ??? ?// TODO Auto-generated method stub
?? ??? ?System.out.println("歡迎使用答答租車系統(tǒng)!");? //歡迎界面
?? ??? ?System.out.println("是否進入系統(tǒng)?/n是 1 否 0");? //防誤選階段
?? ??? ?int num= scanner.nextInt();
?? ??? ?if(num==1)??????? //選車階段
?? ??? ?{
?? ??? ??? ?
?? ??? ??? ?show1.show();
?? ??? ??? ?auto1.showMessageAll();
?? ??? ??? ?track1.showMessageAll();
?? ??? ??? ?special1.showMessageAll();
?? ??? ?}else
?? ??? ??? ?System.out.println("Over!");
?? ??? ?System.out.println("請輸入您要租車的數量"); ?
?? ??? ?Scanner s=new Scanner(System.in);
?? ??? ?int carNum=s.nextInt();
?? ??? ?int[] carNum2=new int[carNum];
?? ??? ?for(int a=0;a<carNum;a++)
?? ??? ?{
?? ??? ??? ?System.out.println("請您輸入第"+(a+1)+"量車的序號");
?? ??? ??? ?int num2=s.nextInt();
?? ??? ??? ?carNum2[a]=num2;
?? ??? ?}
?? ??? ?System.out.println("請您輸入租車的天數");
?? ??? ?int carDays=s.nextInt();
?? ??? ?System.out.println("您的賬單有");
?? ??? ?AutoCar auto2=new AutoCar();
?? ??? ?Track track2=new Track();
?? ??? ?Special special2=new Special();
?? ??? ?int sumMoney=0;
?? ??? ?for(int a=0;a<carNum;a++)
?? ??? ?{
?? ??? ??? ?switch(carNum2[a])
?? ??? ??? ?{
?? ??? ??? ?case 1:{
?? ??? ??? ??? ?auto2.showMessage1();
?? ??? ??? ??? ?sumMoney+=auto2.AM1;
?? ??? ??? ?}break;
?? ??? ??? ?case 2:{
?? ??? ??? ??? ?auto2.showMessage2();
?? ??? ??? ??? ?sumMoney+=auto2.AM2;
?? ??? ??? ?}break;
?? ??? ??? ?case 3:{
?? ??? ??? ??? ?auto2.showMessage3();
?? ??? ??? ??? ?sumMoney+=auto2.AM3;
?? ??? ??? ?}break;
?? ??? ??? ?case 4:{
?? ??? ??? ??? ?track2.showMessage1();
?? ??? ??? ??? ?sumMoney+=track2.tm1;
?? ??? ??? ?}break;
?? ??? ??? ?case 5:{
?? ??? ??? ??? ?track2.showMessage2();
?? ??? ??? ??? ?sumMoney+=track2.tm2;
?? ??? ??? ??? ?
?? ??? ??? ?}break;
?? ??? ??? ?case 6:{
?? ??? ??? ??? ?special2.showMessage1();
?? ??? ??? ??? ?sumMoney+=special2.sm1;
?? ??? ??? ?}break;
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?}
?? ??? ?System.out.println("總共的金額為:"+(sumMoney*carDays));
?? ??? ?
?? ??? ?
?? ??? ?
?? ??? ?
?? ??? ?
?? ??? ?
?? ??? ?
?? ??? ?

?? ?}

}

正在回答

3 回答

在第三季中會重點講,你還沒有看到,所以看不懂沒關系,在你能力范圍之內能看懂就好了,主要是面向對象的思路,我自己寫的也很渣,和大神那個思路也不同,不過看了他的后感覺學習了好多,加油

0 回復 有任何疑惑可以回復我~
#1

大明狗 提問者

我剛剛看完第三季,準備回頭再來看一下這些練習,感覺越到后期知識點越雜亂了,已經有點暈了
2015-08-13 回復 有任何疑惑可以回復我~

這個可以用集合框架知識 ?會簡單點 ?希望對你用幫助

0 回復 有任何疑惑可以回復我~
#1

大明狗 提問者

什么意思啊。。不懂,能詳細點嗎?
2015-08-08 回復 有任何疑惑可以回復我~

我自己寫完了以后才看大神的代碼的,感覺整體上都和我的思路不太相同啊。。而且很多方法本人都看不懂

1 回復 有任何疑惑可以回復我~
#1

qq_飄逸的劉海_0

list 的使用就完全不知道是什么!
2015-08-11 回復 有任何疑惑可以回復我~
#2

大明狗 提問者 回復 qq_飄逸的劉海_0

這個要到第三季才講的
2015-08-11 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

純小白,沒有用大神的一些方法(看了也不懂),也沒有封裝,希望提一些意見

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號