作业 上机练习 5

来源:互联网 发布:第一岛链 知乎 编辑:程序博客网 时间:2024/06/06 19:44
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();} }

原创粉丝点击