// @(#)$Id: BankAccount.C,v 1.7 1997/07/24 21:49:11 leavens Exp $

#include "BankAccount.h"

BankAccount::BankAccount(Money amt, const char *own) throw()
  : bal(new Money(amt)), ownr(own)
{
}

BankAccount::~BankAccount()  throw()
{
}

Money BankAccount::balance() const  throw()
{
  return *bal;
}

// the functions below leak memory (:->)

void BankAccount::pay_interest(double rate)  throw()
{
  bal = & (*bal * (1.0 + rate));
}

void BankAccount::deposit(Money amt)  throw()
{
  bal = & (*bal + amt);
}

void BankAccount::withdraw(Money amt)  throw()
{
  bal = & (*bal - amt);
}

