import java.util.*; import java.awt.*; import Exceptions; // // Generic Account class // abstract class Account { // Account name - only accesible through the generic Account class protected String name; // last date when interest was computed protected int date; // the balance and interest value for the current account protected double balance; protected double interest; // output area TextArea output; // Account constructor Account(String accountname, double accountinterest, TextArea out) throws NoNameException { name=new String(accountname); if(name.equals("")) throw new NoNameException(); balance=0.0f; // when creating an account it has a balance of 0$! date=1; // each account is considered as opened on the 1st of // each month. These are actually "virtual" months in order // to avoid paying the month interest to an account opened // on 31st, for example interest=accountinterest; output=out; } abstract void Deposit(double amount) throws NegativeAmountException,InvalidDepositException; abstract void Withdraw(double amount) throws NoExtraCreditException,NegativeAmountException, CDNegativeBalanceException,MinBalanceException; abstract void Output(); final String Name() { return (name); } final double Balance() { return (balance); } private protected abstract void ComputeInterest(); abstract void Update(); }