#include #include #include #include #include enum Exception {NEGATIVEAMOUNT, NEGATIVERATE, NOTENOUGHAMOUNT, ACCOUNTNOTFOUND, ACCOUNTEXISTS}; enum Currency {TL,EURO,DOLAR}; enum TransType {OPEN,WITHDRAW,DEPOSIT,TRANSIN,TRANSOUT}; struct Money { Currency type; double amount; double rate; Money(double amnt=0.0,Currency ty=TL, double rt=1.0); }; class Transaction { TransType t_type; Money trans_money; time_t calendertime; struct tm trans_time; int trans_id; char trans_ownername[41]; public: Transaction(TransType, Money); Transaction(TransType, Money,int,const char []); double operator! (); int operator< (Transaction &); friend ostream & operator<< (ostream &,Transaction &); }; class Account { int id; char ownername[41]; double currentmoney; struct Transst { Transaction t; Transst *next; Transst(TransType newtype,Money m,int newid=0,const char newname[]=""):t(newtype,m,newid,newname){next=NULL;} } *head,*tail; void DellTransactions(); void CopyTransactions(Account &); public: Account(int,const char[],Money); Account(int,const char[]); Account(Account &); ~Account(); int getid(); const char * getname(); double getamount(); Account & operator= (Account &); Account & operator+ (Money); Account & operator- (Money); Account & transferto(Account &,Money); Account & transferfrom(Account &,Money); Account & operator|=(Account &); friend ostream & operator<< (ostream &,Account &); }; class Bank { char bankname[41]; struct Accountst { Account t; Accountst *next; Accountst(int id,const char newname[]):t(id,newname){next=NULL;} Accountst(int id,const char newname[],Money newmoney):t(id,newname,newmoney){next=NULL;} Accountst(Accountst &rhs):t(rhs.t){next=NULL;} } *head,*tail; void DellAccounts(); friend const char *Getbankname(Bank &); friend void CopyAccounts(Bank &,Bank &); public: Bank(const char newname[]){strcpy(bankname,newname); head=tail=NULL;} Bank(Bank &); ~Bank(); void newAccount(int,const char[]); void newAccount(int,const char[],Money); Bank & operator=(Bank &); Account &operator[](int); Account &operator[](const char []); void deleteAccount(int); void deleteAccount(const char[]); friend ostream & operator<< (ostream &,Bank &); };