最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

我最后輸出的總價(jià)格什么的都是0,為什么。

package com.imooc;

import java.util.*;


public class Test {



public static void main(String[] args) {

// TODO Auto-generated method stub

List<car> cars = new ArrayList<car>();

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

? ? ? ? ?System.out.println("你是否要租車(chē) : 1 是 2 否");

? ? ? ? ?

? ? ? ? ?car aodi=new aodi();

? ? ? ? ?cars.add(aodi);

? ? ? ? ?car jinlong=new jinlong();

? ? ? ? ?cars.add(jinlong);

? ? ? ? ?car mazida=new mazida();

? ? ? ? ?cars.add(mazida);

? ? ? ? ?car pikaxue=new pikaxue();

? ? ? ? ?cars.add(pikaxue);

? ? ? ? ?car song=new song();

? ? ? ? ?cars.add(song);

? ? ? ? ?car yiweike=new yiweike();

? ? ? ? ?cars.add(yiweike);

? ? ? ??

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

? ? ? ? ?int num=k.nextInt();

? ??

? ? ? ? ?if(num==1){

? ? ? ? System.out.println("你可租車(chē)得類(lèi)型及價(jià)格表:"+"\n"+"序號(hào)"+"\t"+"汽車(chē)名稱(chēng)"+"\t"+"租金"+"\t"+"載人"+"\t"+"容量");

? ? ? ? aodi.Car(1);

? ? ? ? jinlong.Car(2);

? ? ? ? mazida.Car(3);

? ? ? ? pikaxue.Car(4);

? ? ? ? song.Car(5);

? ? ? ? yiweike.Car(6);

? ? ? ? System.out.println("請(qǐng)輸入你要的汽車(chē)數(shù)量:");

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

? ? ? ? int b=amount.nextInt();

? ? ? ? int c;

? ? ? ? int allmanned=0;

? ? ? ? int allcargo=0;

? ? ? ? int allrent=0;

? ? ? ? String person="";

? ? ? ? String Cars="";

? ? ? ? for(int i=1;i<=b;i++){

? ? ? ? do{

? ? ? ? System.out.println("請(qǐng)輸入第"+i+"輛車(chē)的序號(hào)");

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

? ? ? ? c=k2.nextInt();

? ? ? ? }while(c<1||c>6);

? ? ? ?

? ? ? ?

? ? ? ? car cc=cars.get(c-1);

? ? ? ? if(cc.manned>0){

? ? ? ? allmanned+=cc.manned;

? ? ? ? person+=cc.name+"";

? ? ? ? }

? ? ? ? if(cc.cargo>0){

? ? ? ? allcargo+=cc.cargo;

? ? ? ? Cars+=cc.name+""; ? ? ? ?

? ? ? ? }

? ? ? ? allrent+=cc.rent;

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

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

? ? ? ? int t=k3.nextInt();

? ? ? ? allrent*=t;

? ? ? ? System.out.println("你的賬單:"+"\n"+"可載人的車(chē)有:"+person+"\t"+"共載客:"+allmanned);

? ? ? ? System.out.println("可載貨的車(chē)有:"+Cars+"共載貨"+allcargo);

? ? ? ? System.out.println("總租金為:"+allrent);

? ? ? ? }

? ? ? ? ?}

? ? ? ? ?

}



}


正在回答

1 回答

有參考成分。從car cc=cars.get(c-1);開(kāi)始沒(méi)有跳入if語(yǔ)句中。

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

舉報(bào)

0/150
提交
取消

我最后輸出的總價(jià)格什么的都是0,為什么。

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