-
Notifications
You must be signed in to change notification settings - Fork 0
/
Account.java
58 lines (45 loc) · 1.1 KB
/
Account.java
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
public class Account {
private String acc_No;
private String pass;
private int balance;
public Account()
{
this("No info","NO info",0);
}
public Account(String acc_No, String pass, int balance) {
this.acc_No = acc_No;
this.pass = pass;
this.balance = balance;
}
public String getAcc_No() {
return acc_No;
}
public void deposit (int balance)
{
this.balance += balance;
}
public void withdraw (int balance)
{
if ( this.balance < balance )
{
System.out.println("YOU DONT HAVE ENOUGH MONEY!");
}
else
this.balance -= balance;
}
public String getPass() {
return pass;
}
public int getBalance() {
return balance;
}
public void setAcc_No(String acc_No) {
this.acc_No = acc_No;
}
public void setPass(String pass) {
this.pass = pass;
}
public void setBalance(int balance) {
this.balance = balance;
}
}