//******************************************************************** // Account.java Author: Sophie Quigley // // Account class describes bank accounts // //******************************************************************** public class Account4 { public int accountID; private int balance; private Customer4 customer; public Account4 (Customer4 newcustomer) { customer = newcustomer; accountID = 1; balance = 0; } public void WhoAmI () { System.out.println("Account="+accountID+"; Balance="+balance+"; Belonging to customer:"); customer.WhoAmI(); } public void Deposit (int amount) { balance = balance + amount; } public boolean Withdraw (int amount) { if (amount <= balance) { balance = balance - amount; return true; } else { System.out.println("Sorry you have unsufficient funds to cover withdrawal."); return false; } } public int Balance () { return balance; } }