ATM机代码实现

package ATM;


import java.io.Serializable;


public class Account implements Serializable {
// 卡号
private String cardNumber;
// 户主名称
private String Name;
// 密码
private int pwd;
// 可用余额
private double money;


public String getCardNumber() {
return cardNumber;
}


public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}


public String getName() {
return Name;
}


public void setName(String name) {
Name = name;
}


public int getPwd() {
return pwd;
}


public void setPwd(int pwd) {
this.pwd = pwd;
}


public double getMoney() {
return money;
}


public void setMoney(double money) {
this.money = money;
}


// 构造函数
public Account(String cardNumber, String name, int pwd, double money) {
this.cardNumber = cardNumber;
this.Name = name;
this.pwd = pwd;
this.money = money;
}


// 账户余额增加
public void addMoney(double m) {
this.money = money + m;
}


// 账户余额减少
public void minusMoney(double m) {
this.money = money - m;
}


}

你可能感兴趣的:(ATM机代码实现)