欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

java滿減打折代碼 打折java實現(xiàn)

用java寫出商品打折程序

嘗試解答一下,這個里面還有老年和教師的判斷就省略,主要是打折的代碼

創(chuàng)新互聯(lián)-云計算及IDC服務(wù)提供商,涵蓋公有云、IDC機房租用、成都服務(wù)器托管、等保安全、私有云建設(shè)等企業(yè)級互聯(lián)網(wǎng)基礎(chǔ)服務(wù),溝通電話:028-86922220

import?java.util.Scanner;

class?Test{

public?static?void?main?(String[]?args){

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

System.out.println("請輸入消費的金額:");

double?oldprice?=?sc.nextDouble();

double?newprice;

if(oldprice?=?2000){

newprice?=?oldprice?*?春笑0.85;

}else?if(oldprice?=?1000??oldprice??2000){

伍做???????newprice?=?oldprice?*?0.9;

}else

newprice?=?oldprice;

Judge?jud?=?new?Judge();

if(jud.isTeacher()||?jud.isOldman())

newprice?=?newprice?*?0.95;

System.out.println("打折后的價格是:"?+?newprice);

System.out.println("折扣的程度是:?"?+?newprice?/?oldprice);

}

}

class?Judge{

public?boolean?isTeacher(){

boolean?isTeacher?=?false;

return?isTeacher;

}

public?boolean?isOldman(){

boolean?isOld?=?false;

腔森衡??????return?isOld;

}

}

求java代碼,關(guān)于會員折扣的

boolean user=true;

double jg=100;

int xfcount;

三個變凳碰量自己吵搜決定升粗歷

if(user){

jg*0.9;

}

if(user==falsexfcount200){

jg*0.9;

}

if(user==truexfcount200){

jg*0.8;

}

求大神幫忙,謝謝!!!!!(要Java代碼)

//第一題的答案:

import?java.util.Scanner;

public?class?test?{

public?static?void?main(String[]?args)

{

System.out.println("輸入購買金額:");

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

double?a=input.nextDouble();

System.out.println("輸入顧客類型(會員或普通):");

String?b=input.next();

if(b=="會員")

{

if(a=100)

{

a=a*0.8;

System.out.println("需付款:"+a);

}

else

{

System.out.println("攜州需付款:"+a);

}

}

if(b=="普通")

{

if(a=200)

{

a=a*0.75;

System.out.println("需付款:"+a);

}

else

{

System.out.println("需付款:"+a);

}

}

}

}

//下面是第二題答案:

public?class?test?{

public?static?void?main(String[]?args)

{ ???????陵爛????

for(int?i?=?0;?i??3;?i++)?

{?

for(int?x?=?i?+?1;?x??3;?x++)?

{?

System.out.print("?");?

}?

for(int?y?=?0;?y??(i?+?1)?*?2?-?1;?y++)?

{?

System.out.print("*");?

}?

System.out.println();?

}?

尺隱漏??????for(int?i?=?0;?i??4;?i++)?

{?

for(int?x?=?0;?x??i;?x++)?

{?

System.out.print("?");?

}?

for(int?y?=?i;?y??2?*?4?-?i?-?1;?y++)?

{?

System.out.print("*");?

}?

System.out.println();?

}

}

}

文章名稱:java滿減打折代碼 打折java實現(xiàn)
轉(zhuǎn)載注明:http://www.chinadenli.net/article14/ddpgede.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站移動網(wǎng)站建設(shè)網(wǎng)站改版域名注冊響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計