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

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

貌似完成了

package carsystem;


import java.util.Scanner;


public class Initail {


public static void main(String[] args) {

// TODO Auto-generated method stub

while(true){

System.out.println("歡迎使用答答租車系統(tǒng):"+"\n"+"您是否要租車(1.是 ?0.否)");

Scanner input=new Scanner(System.in);

int a=input.nextInt();

if(a==0) break;

else {

List(args);

}

}

}

public static void List(String[] args){

System.out.println("您可租車的類型及其價(jià)目表:");

System.out.println("序號(hào) ? ? ? 汽車名稱 ? ? ? 租金 ? ? ? ? ? ? ? ? ? 容量");

System.out.println("1. ?奧迪A4 ?500元/天 ? ? ? ? 載人:4人");

System.out.println("2. ?馬自達(dá)6 ?400元/天 ? ? ? ?載人:4人");

System.out.println("3. ?皮卡雪6 ?450元/天 ? ? ? ?載人:4人 ? ?載貨:2噸");

System.out.println("4. ?金龍 ? ? ? ? ? ? ? 800元/天 ? ? ? ?載人:20人");

System.out.println("5. ?松花江 ? ? ? ? ? 400元/天 ? ? ? ?載貨:4噸");

System.out.println("6. ?依維柯 ? ? ? ? ?1000元/天 ? ? 載貨:20噸");

Carchoose(args);

}

public static void Carchoose(String[] args){

int[] list={0,0,0};

System.out.println("請(qǐng)輸入您要租的汽車的數(shù)量:");

Scanner car1=new Scanner(System.in);

int num1=car1.nextInt();

for(int i=1;i<=num1;i++){

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

Scanner car2=new Scanner(System.in);

int num2=car2.nextInt();

switch(num2){

case 1:

? ?list[0]+=500;

list[1]+=4;

break;

case 2:

list[0]+=400;

list[1]+=4;

break;

case 3:

list[0]+=450;

list[1]+=4;

list[2]+=2;

break;

case 4:

list[0]+=800;

list[1]+=20;

break;

case 5:

list[0]+=400;

list[2]+=4;

break;

case 6:

list[0]+=1000;

list[2]+=20;

break;

}

}

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

Scanner day=new Scanner(System.in);

int daychoose=day.nextInt();

list[0]*=daychoose;

System.out.println("您的賬單:");

System.out.println("**可載"+list[1]+"人");

System.out.println("**可載"+list[2]+"噸物");

System.out.println("**租車總價(jià)格:"+list[0]+"元");

}


}



正在回答

2 回答

獲取控制臺(tái)的輸入沒(méi)有關(guān)閉 , ?input.close();

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

提示:

Resource leak:'input'is never closed

是什么原因

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

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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