public class Customer
{
public String cardType;
public int score;
public void show()
{
System.out.println("积分"+score+"卡类型"+score);
if(cardType.equals("金卡")&&score>1000){
System.out.println("回馈积分"+500);
}else if(score>5000) {
System.out.println("回馈积分"+500);
}else {
System.out.println("没有回馈积分");
}
}
}
public class Tsetcustomer {
public static void main(String[]args){
Customer customer=new Customer();
customer.cardType="金卡";
customer.score=5000;
customer.show();
}
}
作业 上机练习 5
最新推荐文章于 2016-11-25 16:58:43 发布