Commit dee4d9c0 authored by elliot.copeland's avatar elliot.copeland

Exercise Complete

parent e30b71c1
...@@ -19,8 +19,11 @@ public class App { ...@@ -19,8 +19,11 @@ public class App {
test.addOverdraft(500); test.addOverdraft(500);
test.withdrawal(800); test.withdrawal(800);
test.display(); test.display();
test.accrueIntrest();
System.out.println(" "); System.out.println(" ");
System.out.println("~~~~~~~~~~~~~~~~~~Testing savings account~~~~~~~~~~~~~~~~~~~~~~"); System.out.println("~~~~~~~~~~~~~~~~~~Testing savings account~~~~~~~~~~~~~~~~~~~~~~");
BankAccount test2 = new SavingAccount(900, "Bob", 100); BankAccount test2 = new SavingAccount(900, "Bob", 100);
test2.display(); test2.display();
...@@ -35,6 +38,7 @@ public class App { ...@@ -35,6 +38,7 @@ public class App {
System.out.println(" "); System.out.println(" ");
test2.bankFees(); test2.bankFees();
test2.accrueIntrest();
test2.display(); test2.display();
System.out.println(" "); System.out.println(" ");
......
...@@ -38,4 +38,8 @@ public class BankAccount { ...@@ -38,4 +38,8 @@ public class BankAccount {
public void addOverdraft(float od) { public void addOverdraft(float od) {
overdraft = od; overdraft = od;
} }
public void accrueIntrest() {
System.out.println("A standard account cannot accrue intrest.");
}
} }
...@@ -4,8 +4,9 @@ public class SavingAccount extends BankAccount { ...@@ -4,8 +4,9 @@ public class SavingAccount extends BankAccount {
super(accountnumber, uname, cbalance); super(accountnumber, uname, cbalance);
} }
@Override
public void accrueIntrest() { public void accrueIntrest() {
balance += (balance + (balance * 0.05f)); balance += (balance * 0.05f);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment