
根据题目意思定义Account类
public class Account {
private String id;
private String password;
private String name;
private double money;
public Account(String id, String name, String password, double money) {
this.id = id;
this.password = password;
this.name = name;
this.money = money;
}
public void showInfo(){
System.out.println("账号:"+id+"\n姓名:"+name+"\n金额:"+money);
}
public double getInterest(){
return money*0.25/100;
}
}
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!