Commit 4ac93f8a authored by sam.pople's avatar sam.pople

Finished

parent e30d2705
public class BankAccount { public class BankAccount {
// Transactions are in pence
public BankAccount(int accountNumber, String name, int balance) { public BankAccount(int accountNumber, String name, int balance) {
this.Accountnumbervalue(accountNumber); this.Accountnumbervalue(accountNumber);
this.Namevalue(name); this.Namevalue(name);
...@@ -69,6 +67,9 @@ public class BankAccount { ...@@ -69,6 +67,9 @@ public class BankAccount {
return "£" + string.substring(0, string.length() - 2) + "." + string.substring(string.length() - 2, string.length()); return "£" + string.substring(0, string.length() - 2) + "." + string.substring(string.length() - 2, string.length());
} }
} }
public void bankFees() throws Exception {
this.Balancevalue(((int) Math.round(this.getBalance() * this.getFees())));
}
public void deposit(int amount) throws Exception { public void deposit(int amount) throws Exception {
this.Balancevalue(this.getBalance() + amount); this.Balancevalue(this.getBalance() + amount);
} }
...@@ -83,9 +84,7 @@ public class BankAccount { ...@@ -83,9 +84,7 @@ public class BankAccount {
return true; return true;
} }
} }
public void bankFees() throws Exception {
this.Balancevalue(((int) Math.round(this.getBalance() * this.getFees())));
}
public void display() throws Exception { public void display() throws Exception {
System.out.println("Bank details: "); System.out.println("Bank details: ");
System.out.println("\nAccount no.: " + this.getAccountNumber() + "\nAccount holder: " + this.getName()); System.out.println("\nAccount no.: " + this.getAccountNumber() + "\nAccount holder: " + this.getName());
......
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