资讯

精准传达 • 有效沟通

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

Java超市打折积分代码 java内部购物券代码

急!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写出商品打折程序

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

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 练习 根据会员积分,计算所享受的折扣。

package com.javaeye.morflame;

import java.util.Scanner;

public class Test {

public static void main(String[] args) {

Scanner in=new Scanner(System.in);

System.out.print("输入积分:");

int a=in.nextInt();

int result=zhekou(a);

System.out.println("折扣为"+result+"折");

}

//求折扣的函数

private static int zhekou(int a) {

int result=0;

if(a2000)

{

result= 9;

}

else if(a4000){

result= 8;

}

else if(a8000){

result= 7;

}

else if(a=8000){

result= 6;

}

else{

System.out.println("输入的积分不在范围内!");

}

return result;

}

}

如果楼主觉得还不行,自己在这个基础上改一下下代码肯定就OK了

求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积分兑换代码

联合查询 select * from userinfo a ,integrationpresent b where a.integration=b.integration (如果有错 取别名时加 as )

JAVA 大家帮忙看一下怎么做 会员积分x x

Java程序:

import java.util.Scanner;

public class xll {

public static void main(String[] args) {

int score;

double count = 1.0;

Scanner input = new Scanner(System.in);

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

score = input.nextInt();

if(score 2000)

count = 0.9;

else if(score 4000)

count = 0.8;

else if(score 8000)

count = 0.7;

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

System.out.println(count + "折");

}

}

运行测试:

请输入会员积分:

5000

该会员享受的折扣是:

0.7折

请输入会员积分:

3420

该会员享受的折扣是:

0.8折

有一问题,如果积分超过8000是几折?


网站标题:Java超市打折积分代码 java内部购物券代码
标题网址:http://cdkjz.cn/article/hicgej.html
多年建站经验

多一份参考,总有益处

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

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

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