-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathBusinessAccount.java
More file actions
52 lines (36 loc) · 968 Bytes
/
BusinessAccount.java
File metadata and controls
52 lines (36 loc) · 968 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* Created by prestonbattin on 1/19/17.
*/
public class BusinessAccount extends Account{
static private int accountCount = 1;
private int businessAccountNumber;
private double interest = 2.5;
BusinessAccount(String name, double balance){
super(name, balance);
this.businessAccountNumber = accountCount;
accountCount++;
this.interest = interest;
}
@Override
protected void creditAccount(double amount) {
this.balance += amount;
}
@Override
protected void debitAccount(double amount) {
this.balance -= amount;
}
@Override
public double getBalance(){
return super.getBalance();
}
public int getBusinessAccountNumber(){
return this.businessAccountNumber;
}
@Override
public String getAccountName(){
return super.getAccountName();
}
public double getInterest(){
return this.interest;
}
}