/* Name: account.h * Purpose: Header for Bank Account Class * Author: Dr. Michael A. Redmond * Date Written: 05/04/98 * Date Revised: 02/11/00 * NOTES: */ #ifndef ACCOUNT_H #define ACCOUNT_H // in account.h #include // allows string handling #include using namespace std; class Account { public: // constructors Account(); Account(const string& numb, double bal = 0.0); // mutators // // Deposit adds money to the account - returning true if deposit // was successfull // Deposit amount must be greater than 0 - if not return false + msg to cerr bool Deposit (double amt); // Withdraw subtracts money from the account - returning true if Withdrawl // was successfull // withdraw amount must be greater than 0 - if not return false + msg to cerr // account must have enough money - if not return false + msg to cerr bool Withdraw (double amt = 60); // inspectors // Find Out current Balance double GetBal () const; // Find out account number string GetAcctNum () const; // report whether a given account number is the one for an account bool ThisAcct (const string & acctNum); protected: private: string acctNum; int PIN; // PIN should be an integer less than or equal 9999 // not used yet!! double balance; }; // allows outputting all info about account ostream& operator << (ostream & strOut, Account & myAcct); // reports whether one account has greater balance than another bool operator > (const Account & lhs, const Account & rhs); // reports whether one account has same balance as another bool operator == (const Account & lhs, const Account & rhs); // reports whether one account has lower balance than another bool operator < (const Account & lhs, const Account & rhs); #endif