/*	Implements a bank account class which maintains and 
	can display a list of all transaction 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:
	AccountClass();
	/*	Default constructor */

	AccountClass(lvpstring AcctName, lvpstring AcctOpenDate);
	/*	Opens AcctName account on AcctOpenDate.
		Post: AcctName balance is zero, and transaction recorded */

	bool 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.                                         */

	void SpecifyAccount(lvpstring AcctName, lvpstring AcctOpenDate);
	/*	Assigns AcctName and AcctOpenDate to account if account not initialized
	Post: AcctName assigned to Name and AcctOpenDate assigned to
	OpenDate if account was not already initialized. IsOpen is true.                */

	lvpstring GetName() const;
	/*	Determines account name
	Post: Name returned          */ 


private:
	lvpstring Name;
	lvpstring OpenDate;
	double Balance;
	lvpvector<lvpstring> TransDates, TransKinds;
	lvpvector<double> TransAmts;
   bool IsOpen;
};

#include "account2.cpp"

