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

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么最后報錯顯示 shiJi cannot be resolved to a variable 。

為什么最后報錯顯示 shiJi cannot be resolved to a variable 。

蘇文進(jìn) 2017-06-08 10:27:38
package?臨時; import?java.util.Scanner; public?class?xioafei?{ public?static?void?main(String[]?args){ Scanner?input=new?Scanner(System.in); System.out.print("請輸入您的消費總額:"); int?zongE=input.nextInt(); System.out.println(); ????????System.out.println("請出示您的會員卡:"); ????????int?huiYuan=input.nextInt(); ????????if(huiYuan==1) ????????{ ???????? double?shiJi=zongE*0.6; ???????? if(huiYuan==2) ???????? { ???????? ?????shiJi=zongE*0.7; ???????? if(huiYuan==3) ???????? { ???????? ??shiJi=zongE*0.8; ???????? if(huiYuan==4) ???????? { ???????? ?shiJi=zongE*0.85; ???????? if(huiYuan==5) ???????? { ???????? ??shiJi=zongE*0.9; ???????? if(huiYuan==6) ???????? { ???????? ?shiJi=zongE*0.95; ???????? } ???????? } ???????? } ???????? } ???????? } ????????} ????????double?zheKou=zongE-shiJi; ????????System.out.println("消費總金額為"+zongE+"元,實際支付"+shiJi+"元,折后為"+zheKou+"元。"); } }
查看完整描述

1 回答

已采納
?
李曉健

TA貢獻(xiàn)1036條經(jīng)驗 獲得超461個贊

雖然這是一個java題,我就斗膽回答一下,

double?shiJi=zongE*0.6; ?應(yīng)該放到 if的最外面,應(yīng)該是變量作用域的問題

查看完整回答
1 反對 回復(fù) 2017-06-08
  • 1 回答
  • 0 關(guān)注
  • 1557 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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