/*	Implements a bank account class which maintains and 
	can display a list of all transactions on the account            */

#include <iostream.h>
//#include <lvp\bool.h>
#include <lvpstring.h>
#include <lvpvector.h>

using namespace std;	// October 5, 2001

class AccountClass {
public:
	//	Constructor
	AccountClass(lvpstring AcctName, lvpstring AcctOpenDate);
	/*	Opens AcctName account on AcctOpenDate.
		Post: AcctName balance is zero, and transaction recorded */

	void Deposit(double Amt, lvpstring Date);
	/*	Adds deposit to Acct and records transaction
		Post: Amt added to account, and transaction recorded */

	bool Withdrawal(double Amt, lvpstring Date);
	/*	Subtracts withdrawal from account and records transaction
		Post: if Amt<=Balance, Amt deleted from account,
		transaction recorded, and true returned. Otherwise, false returned, 
		attempt recorded, and balance unchanged.                                        */

	double GetBalance() const;
	/*	Determines current balance
		Post: Current balance returned */

	void WriteTransactions(ostream & OutFile) const;
	/*	Writes transactions to OutFile
		Post: All information about the account written to OutFile,
		including a list of all transactions.                                         */

private:
	lvpstring Name;
	lvpstring OpenDate;
	double Balance;
	lvpvector<lvpstring> TransDates, TransKinds;
	lvpvector<double> TransAmts;
};

#include "account.cpp"

