Commit 70f42e14 authored by a-j.towse's avatar a-j.towse

Final commit

parent a911463c
...@@ -2,11 +2,13 @@ public class BankAccount { ...@@ -2,11 +2,13 @@ public class BankAccount {
int accountNumber; int accountNumber;
String name; String name;
double balance; double balance;
double overdraft;
public BankAccount(){ public BankAccount(){
accountNumber = 0; accountNumber = 0;
name = "N/A"; name = "N/A";
balance = 0; balance = 0;
overdraft = 0;
} }
...@@ -22,10 +24,9 @@ public class BankAccount { ...@@ -22,10 +24,9 @@ public class BankAccount {
} }
public void withdrawal(double outAmount){ public void withdrawal(double outAmount){
if (outAmount <= balance || outAmount > 0){ if (outAmount <= balance || outAmount > 0 - overdraft){
balance -= outAmount; balance -= outAmount;
} }
} }
public void bankFees(){ public void bankFees(){
...@@ -39,7 +40,7 @@ public class BankAccount { ...@@ -39,7 +40,7 @@ public class BankAccount {
System.out.println(balance); System.out.println(balance);
} }
public void addOverdraft(double overdraft){ public void addOverdraft(double over){
double overdraft = over;
} }
} }
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