资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

java打折代码 java商场打折程序

编写一个java消费单算出折扣怎么写如图

没有理解你的问题,是想打印出图上的效果,还是说告诉我原价和折后价让我算折扣?

印台网站建设公司创新互联,印台网站设计制作,有大型网站制作公司丰富经验。已为印台上千提供企业网站建设服务。企业网站搭建\外贸营销网站建设要多少钱,请找那个售后服务好的印台做网站的公司定做!

求java代码,关于会员折扣的

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 Test1 {

public static void main(String[] args) {

System.out.println("请输入会员积分:");

Scanner sc=new Scanner(System.in);

int a=sc.nextInt();

sc.close();

if(a200){

System.out.println("该会员享受的折扣是:0.9");

}else if(a=2000a=4000){

System.out.println("该会员享受的折扣是:0.8");

}else if(a=4000a=8000){

System.out.println("该会员享受的折扣是:0.7");

}else if(a=8000){

System.out.println("该会员享受的折扣是:0.6");

}

}

}

我有道java编程小题求编程:商场价格打折 无需界面

写一个简单点的商品类Product

属性有

String pName;

double pPrice;

int pPiscount;//打折范围1-9

然后写一个业务,购买商品,添加到一个List集合.

结账的时候,你自己选5个要求中的其中一个,并且在业务方法里面实现这5个需求.........

求大神帮忙,谢谢!!!!!(要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写出商品打折程序

尝试解答一下,这个里面还有老年和教师的判断就省略,主要是打折的代码

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打折代码 java商场打折程序
网页网址:http://cdkjz.cn/article/docsdss.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220