-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSavingsAccount.java
More file actions
33 lines (25 loc) · 878 Bytes
/
SavingsAccount.java
File metadata and controls
33 lines (25 loc) · 878 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
public class SavingsAccount extends BankAccount{
double Interest;
double AmountLimit;
SavingsAccount(String memberName, double accountBalance, double minimumBalance,double AmountLimit) {
super(memberName, accountBalance, minimumBalance);
this.AmountLimit = AmountLimit;
}
public double getBalanceWithInterest()
{
Interest = 12*(accountBalance*.05);
accountBalance = accountBalance+ Interest;
return accountBalance;
}
public void withdrow(double amount)
{
if ( accountBalance >amount && AmountLimit>=amount &&(accountBalance-amount) >= minimumBalance)
{
accountBalance = accountBalance - amount;
}
else
{
System.out.println("\nInsufficient Balance!!!Please Check Balance!!!");
}
}
}