-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
95 lines (73 loc) · 1.45 KB
/
User.java
File metadata and controls
95 lines (73 loc) · 1.45 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
public class User
{
private String id;
private String role;
private String password;
private boolean isAdmin;
private double checking_balance;
private double savings_balance;
public User()
{
this.isAdmin = false;
this.id = "0";
this.password = "default";
this.checking_balance = 0.0;
this.savings_balance = 0.0;
}
public User(String myId,String myPassword,boolean myAdminState,double checking, double savings)
{
this.id = myId;
this.password = myPassword;
this.isAdmin = myAdminState;
this.checking_balance = checking;
this.savings_balance = savings;
}
public String getPassword()
{
return password;
}
public void setPassword(String myPassword)
{
this.password = myPassword;
}
public String getRole()
{
if(getId().charAt(0)=='S')
{
role="Staff";
}
else if(getId().charAt(0)=='M')
{
role="Member";
}
return role;
}
public boolean isAdmin()
{
return isAdmin;
}
public void setAdmin(boolean isAdmin)
{
this.isAdmin = isAdmin;
}
public String getId()
{
return id;
}
public void setId(String id)
{
this.id = id;
}
public double getChecking_balance() {
return checking_balance;
}
public void setChecking_balance(float checking_balance) {
this.checking_balance = checking_balance;
}
public double getSavings_balance() {
return savings_balance;
}
public void setSavings_balance(float savings_balance) {
this.savings_balance = savings_balance;
}
}