-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccount.java
More file actions
35 lines (33 loc) · 788 Bytes
/
Account.java
File metadata and controls
35 lines (33 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package atm;
/*Account 类封装储户信息及部分功能*/
import java.io.*;
public class Account {
private String number = null;
private String name = null;
private String password = null;
private double money = 0.0;
public Account (String number, String name, String password, double money) {
this.number = number;
this.name = name;
this.password = password;
this.money = money;
}
protected String get_Number() {
return number;
}
protected String get_Name() {
return name;
}
protected String get_Password() {
return password;
}
protected double get_Money() {
return money;
}
protected void sub_Balance(double mon) { //余额减少
money -= mon;
}
protected void add_Balance(double mon) { //余额增加
money += mon;
}
}