/*
 * @topic T00715 Banking exception demo
 * @brief Customer class
 */
package banking;
public class Customer
{
    private Account account;
    public Customer( double amount )
    {
        account = new Account(amount);
    }
    public long processTransaction( double amount )
    {
        long txnId = 0;
        try
        {
            txnId = account.withdraw(amount);
        }
        catch (OverdrawException ex)
        {
            System.out.print("\t *** Sorry, ");
            System.out.print(ex.getMessage());
            System.out.print(" $");
            System.out.println(ex.getAmt());
        }
        finally
        {
            return txnId;
        }
    }
    public Account getAccount()
    {
        return account;
    }
} // Customer class