#include #include #include #include "Customer.h" #include "CustomerGold.h" #include "CustomerPlatinum.h" #include "CustomerStandard.h" #include "BAccount.h" #include "BAccountBusiness.h" #include "BAccountStandard.h" #include "BAccountStudent.h" #include "Interface.h" #include "ATM.h" #include "Official.h" #include "Manager.h" void F_ATM(ATM*); void F_Official(ATM*); void F_Manager(ATM*); using namespace std; vector ALLCustomer; vector ALLAccount; void main() { int x; ATM atm; do { cout<< " Bank Manager System" << endl<< endl<< endl; cout<< " What type of user you?" << endl; cout<< " 1. ATM " << endl; cout<< " 2. Official " << endl; cout<< " 3. Manager " << endl; cout<<"Enter choice no.: "; std::cin>>x; switch(x) { case 1: { F_ATM(&atm); break; } case 2: { F_Official(&atm); break; } case 3: { F_Manager(&atm); break; } } } while(1); cin.get(); cin.get(); cin.get(); cin.get(); } void F_ATM(ATM atm) { int x, i, NowAccNu, PlaceInVector; cout<< "Bank Account Number:" <> NowAccNu; for(i=0 ; iAccountNumber==NowAccNu) PlaceInVector=i; } atm.dis(); cout<<"Enter choice no.: "; cin>>x; switch(x) { case 1://Show balance { atm.showBalance(ALLAccount[PlaceInVector]); break; } case 2://Cash deposit { int cash; cout << "Some cash you want to deposit?" <> cash; atm.Deposit(ALLAccount[PlaceInVector], cash); cout << "Done" <> chek; atm.DepositCheck(ALLAccount[PlaceInVector], chek); cout << "Done" <> cash; atm.Withdraw(ALLAccount[PlaceInVector], cash); cout << "Done" <> AccDestination; cout << "How much money you want to transfer specific account?(xx.xx)" <> cash; for(i=0 ; i< ALLAccount.size() ; i++) { if (ALLAccount.at(i)->AccountNumber==AccDestination) AccDestinationPlaceInVector=i; } atm.Trensfer(ALLAccount.at(PlaceInVector), ALLAccount[AccDestinationPlaceInVector], cash); break; } case 6://Exit { /*exit();*/ break; } } } void F_Official(ATM atm) { Official official; int x, i, NowAccNu, PlaceInVector, NowCusNu, z, PlaceInVectorA, PlaceInVectorB; official.dis(); cout<<"Enter choice no.: "; cin>>x; switch(x) { case 1://Adding a new customer { int x,Numbcus; cout<< "What type of new client you want to add to the bank?"<>x; Numbcus=ALLCustomer.size(); if(x==1) { ALLCustomer.push_back(new CustomerGold); ALLCustomer[Numbcus+1]->EntryDetailsNewCustomer(); } if(x==2) { ALLCustomer.push_back(new CustomerPlatinum); ALLCustomer[Numbcus+1]->EntryDetailsNewCustomer(); } if(x==3) { ALLCustomer.push_back(new CustomerStandard); ALLCustomer[Numbcus+1]->EntryDetailsNewCustomer(); } if( x!=1 || x!=2 || x!=3 ) cout<< "Your choice is unacceptable." <> NowCusNu; for(i=0 ; iCusNumber==NowCusNu) PlaceInVector=i; } official.ShowCustomerDetailsAll(ALLCustomer[PlaceInVector]); break; } case 3://update existing customer information { cout << "Customer Number:" <> NowCusNu; for(i=0 ; iCusNumber==NowCusNu) PlaceInVector=i; } official.UpdateCustomerDetailsAll(ALLCustomer[PlaceInVector]); break; } case 4://Fill the required bills ATM { official.GoodMorningATM(&atm); break; } case 5: { break; } case 6: { break; } case 7: { int overdraft=0 ,x; cout<< " Note that "<> NowCusNu; for(i=0 ; iCusNumber==NowCusNu) PlaceInVector=i; } for(i=0 ; iListOfAccount.size() ; i++) { if(ALLCustomer.at(PlaceInVector)->ListOfAccount.at(i) < 0 ) overdraft++; } if(overdraft>=2) { cout<< "System error, this customer there are at least two accounts with overdraft,"<>x; NowAccNu=ALLAccount.size(); if(x==1) { ALLAccount.push_back(new BAccountBusiness); ALLAccount.at(NowAccNu+1)->BelongToCustomer(NowCusNu); } if(x==2) { ALLAccount.push_back(new BAccountStandard); ALLAccount.at(NowAccNu+1)->BelongToCustomer(NowCusNu); } if(x==3) { ALLAccount.push_back(new BAccountStudent); ALLAccount.at(NowAccNu+1)->BelongToCustomer(NowCusNu); } if( x!=1 || x!=2 || x!=3 ) cout<< "Your choice is unacceptable." <> NowAccNu; for(i=0 ; iAccountNumber==NowAccNu) PlaceInVector=i; } official.ShowAccuontDetailsAll(ALLAccount.at(PlaceInVector)); break; } case 9://Update Account Information { cout << "Bank Account Number:" <> NowAccNu; for(i=0 ; iAccountNumber==NowAccNu) PlaceInVector=i; } official.UpdateAccuontDetailsAll(ALLAccount[PlaceInVector]); break; } case 10://Associating a client bank account, and adding an authorized signatory existing account. { cout<< " Customer number? "<>NowCusNu; cout<< " Bank account number? "<>NowAccNu; for(i=0 ; iAccountNumber==NowAccNu) PlaceInVectorA=i; } for(i=0 ; iCusNumber==NowCusNu) PlaceInVectorB=i; } cout<< " What action do you want to do? "<>z; if(z==1) { ALLAccount.at(PlaceInVectorA)->BelongToCustomer(NowCusNu); cout<< " Done successfully "<BelongToAccount(NowAccNu); cout<< " Done successfully "<> NowAccNu; for(i=0 ; iAccountNumber==NowAccNu) PlaceInVectorA=i; } ALLAccount.erase(ALLAccount.begin()+PlaceInVectorA); cout<< " Done successfully "<>x; switch(x) { case 1: { break; } case 2://Adding the account signatory { cout << "What account you want to add authorized signatories? (Account number)" <> NowAccNu; cout << "Which client you want to add an authorized signatory for this account? (Customer number)" <> NowCusNu; for(i=0 ; iAccountNumber==NowAccNu) PlaceInVectorA=i; } for(i=0 ; iCusNumber==NowCusNu) PlaceInVectorB=i; } manager.AddAuthorizedSignatory(ALLCustomer.at(PlaceInVectorB), ALLAccount.at(PlaceInVectorA)); break; } case 3://Removing the account signatory { cout << "What account you want to remove signatories? (Account number)" <> NowAccNu; cout << "Which client you want to remove an authorized signatory for this account? (Customer number)" <> NowCusNu; for(i=0 ; iAccountNumber==NowAccNu) PlaceInVectorA=i; } for(i=0 ; iCusNumber==NowCusNu) PlaceInVectorB=i; } manager.RemoveAuthorizedSignatory(ALLCustomer.at(PlaceInVectorB), ALLAccount.at(PlaceInVectorA)); break; } case 4://Official actions on an existing account. { F_Official(atm); break; } case 5://ATM actions on an existing account. { F_ATM(atm); break; } case 6://Exit { /*exit();*/ break; } } }