-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAcc.java
More file actions
61 lines (50 loc) · 1.18 KB
/
Copy pathBankAcc.java
File metadata and controls
61 lines (50 loc) · 1.18 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
// Give Us All Your Money Bank - Clarence Cheng, Lynne Wang, Frank Chen
//APCS pd 1
//HW 09
//2017-10-02
public class BankAccount {
//Instance Vars
private String AccName;
private String AccPwd;
private int AccPin;
private int AccNum;
private double AccBal;
//Constructors
public BankAccount() {
AccName = "Default";
AccPwd = "000aaa";
AccPin = 0000;
AccNum = 000000000;
AccBal = 0.0;
}
public BankAccount(String Name, String Pwd, int Pin, int Num, float Balance) {
AccName = Name;
AccPwd = Pwd;
AccPin = Pin;
AccNum = Num;
AccBal = Balance;
}
//Methods
public void Deposit(float Amount) {
AccBal += Amount;
}
//Work on withdrawal limit - if your withdrawal amount is greater than your account balance, print a message to the person.
public void Withdraw(float Amount) {
AccBal -= Amount;
}
public String retName() {
return AccName;
}
public String retPwd() {
return AccPwd;
}
public int retPin() {
return AccPin;
}
public int retNum() {
return AccNum;
}
public double retBalance() {
return AccBal;
}
}