코드
// 좌번호 스트링
// list 다 vector로 바꾸는 것
// 예외 사항 처리 (cash transfer 같은 거에서 Y 안들어간 경우,,)
// 계좌번호 틀렸을 때 예외 처리
#include <iostream> #include <string> using namespace std; class Account; class Bank; class ATM; class World; //---------Account--------- class Account { private: string name; // 계좌 주 이름 double account_num; // 계좌번호 int password; // 비밀번호 int balance; // 잔액 string bank; // 계좌 은행 public: Account(string bank_name, string user_name, double account_number, int user_password, int available_funds); string getBankName(); double getAccountNum(); int getPassword(); int getBalance(); void setBalance(int update_balance); // user_name : Account1, bank_name : Kakao, use_name :David, // account_number : 111-111-111111, available_funds (초기 잔액) : 5000 }; //---------------Account implementation Account::Account(string bank_name, string user_name, double account_number, int user_password, int available_funds) { this->bank = bank_name; this->name = user_name; this->account_num = account_number; this->password = user_password; this->balance = available_funds; cout << "[Account Constructor] Account ID: " << this->account_num << endl; } string Account::getBankName() { return this->bank; } double Account::getAccountNum() { return this->account_num; } int Account::getPassword() { return this->password; } int Account::getBalance() { return this->balance; } void Account::setBalance(int update_balance) { this->balance = update_balance; } //---------Bank--------- class Bank { private: string bank_name; Account *account_list[10]; // 모든 account의 리스트 int num_of_accounts; public: static ATM *atm_list[10]; // 모든 ATM 리스트 static int num_of_atm; // atm_list indexing 하기 위한 변수 static Bank *bank_list[10]; // 모든 bank의 list -> atm에서 사용하기 위함 static int num_of_bank; // bank_list indexing 하기 위한 변수 Bank(const string); void addATM(ATM *atm); // atm_list에 ATM을 추가하는 함수 void setAccount(Account *); // 계좌 추가 void getAccount(); // 관리하는 계좌들 출력 void setDeposit(Account *, int money); // deposit 결과 계좌에 반영 void setWithdrawal(Account *account, int money); // withdrawal 결과 계좌에 반영 void setTransfer(Account *account, int money); // transfer 결과 계좌에 반영 bool verifyPassword(Account *account, int pw); // pw가 account 비번 맞는지 확인 Account *findAccount(double ID); string getBankName(); // bank name return Bank *getAllBank(); void printAllAccounts(); }; //---------------Bank implementation int Bank::num_of_atm = 0; // Initialize static variables int Bank::num_of_bank = 0; // Initialize static variables Bank *Bank::bank_list[10]; // Assuming a maximum of 10 banks ATM *Bank::atm_list[10]; // Assuming a maximum of 10 ATMs Bank::Bank(const string name) { this->bank_name = name; bank_list[num_of_bank] = this; // bank_list stack에 생성 num_of_bank++; cout << "[Bank Constructor] Bank name: " << this->bank_name << endl; } void Bank::addATM(ATM *atm) { // atm 추가, atm constructor에서 알아서 돌아감 atm_list[num_of_atm] = atm; // atm_list stack에 생성 num_of_atm++; } void Bank::setAccount(Account *account) { // 우리가 직접 치기 -> 자동으로 하기 account_list[num_of_accounts] = account; num_of_accounts++; } Bank *Bank::getAllBank() { return *bank_list; } void Bank::getAccount() { return; } void Bank::setDeposit(Account *account, int money) { account->setBalance(account->getBalance() + money); } void Bank::setWithdrawal(Account *account, int money) { account->setBalance(account->getBalance() - money); } void Bank::setTransfer(Account *account, int money) { account->setBalance(account->getBalance() + money); } bool Bank::verifyPassword(Account *account, int pw) { if (account->getPassword() == pw) { return true; } return false; } Account *Bank::findAccount(double ID) { for (int i = 0; i < num_of_accounts; i++) { if (account_list[i]->getAccountNum() == ID) { return account_list[i]; } } return nullptr; } string Bank::getBankName() { return this->bank_name; } void Bank::printAllAccounts() { cout << "num of accounts: " << num_of_accounts << endl; for (int i = 0; i < num_of_accounts; i++) { cout << i << ". account number: " << account_list[i]->getAccountNum() << endl; } } //---------ATM--------- class ATM { private: int serial_type; // single bank 이면 1, multi bank 이면 2 Bank *serial_primary_bank; // primary bank의 ptr int serial_lang_type; // unilingual 이면 1, bilingual 이면 2 int count = 0; // authoriaztion 할 때 시도 횟수 세는 변수 int num_of_1000; int num_of_5000; int num_of_10000; int num_of_50000; public: // Bank *bank_list[10]; int serial_num; // serial number Bank *current_bank; // 현재 사용중인 bank Account *current_acc; // 현재 사용중인 account double account_list[10]; // account list int available_cash; // ATM에 남은 돈 ATM(Bank *primary_bank, int serial_number, string type, string language, int initial_1000, int initial_5000, int initial_10000, int initial_50000); // multi bank ATM constructor void addBank(); bool authorization(double account_num); void deposit(); // 여기까지 구현함!! void withdrawal(); bool withdrawal_fee(); void transfer(); void StartSession(Bank **bank_list); bool authorization(); void EndSession(); }; //---------------ATM implementaion // Constructor ATM::ATM(Bank *primary_bank, int serial_number, string type, string language, int initial_1000, int initial_5000, int initial_10000, int initial_50000) { // primary bank setting serial_primary_bank = primary_bank; // atm의 bank serial_primary_bank->addATM( this); // Bank class의 static atm_list에 해당 ATM 추가 // serial number setting serial_num = serial_number; // bank type setting if (type == "Single Bank") { serial_type = 1; } else if (type == "Multi Bank") { serial_type = 2; } else { cout << "[Error] Please enter \"Single Bank\" or \"Multi Bank.\"" << endl; } // language type setting if (language == "Unilingual") { serial_lang_type = 1; } else if (language == "Bilingual") { serial_lang_type = 2; } else { cout << "[ERROR] Please enter \"Unillingual\" or \"Bilingual\"" << endl; } // initial cash setting this->num_of_1000 = initial_1000; // 지폐 갯수 this->num_of_5000 = initial_5000; // 지폐 갯수 this->num_of_10000 = initial_10000; // 지폐 갯수 this->num_of_50000 = initial_50000; // 지폐 갯수 cout << "[ATM Constructor] ATM serial number: " << this->serial_num << endl; cout << "serial type: " << serial_type << endl; cout << "serial lang: " << serial_lang_type << endl; } void ATM::addBank() {} // StartSession void ATM::StartSession(Bank **bank_list) { // bank list를 파라미터로 받아옴 // bank list에 item 어떻게 담아 넣을지 모르겠음 double account_num; // 계좌번호 // string bank_name; // 이 계좌의 은행이 어디인지 확인하는 변수 cout << "Insert card: "; cin >> account_num; // 계좌번호 입력받음 for (int i = 0; i < 10; i++) { // bank_list가 10개라서 이케함, len 따로 구해도 됨 this->current_acc = bank_list[i]->findAccount(account_num); if (current_acc != nullptr) { // 찾으면 break current_bank = bank_list[i]; break; } } if (current_acc == nullptr) { StartSession(bank_list); return; } if (this->authorization() == false) { cout << "Authorization failed" << endl; this->EndSession(); } int action = 0; try { while (true) { cout << "Choose transaction" << endl; cout << "1.Deposit\t 2.Withdrawal\t3.Transfer\t4.Exit : "; cin >> action; cout << endl; if (action == 1) { deposit(); count++; } else if (action == 2) { withdrawal(); count++; } else if (action == 3) { transfer(); count++; } else if (action == 4) { break; } else { cout << "[ERROR] Please enter 1~4" << endl; } } } catch (int e) { cout << "Session finished" << endl; return; } } // stop void ATM::EndSession() { throw 1; } // 3. User Authorization bool ATM::authorization() { cout << "Authorization Started" << endl; int password; // REQ3.1 카드가 atm 기기의 타입에 맞는 유효한 카드인지 확인함 // REQ3.2 유효하지 않으면 -> display error message(ex.”Invalid Card”) if ((this->serial_type == 1) && (current_acc->getBankName() != serial_primary_bank->getBankName())) { // ATM이 single bank ATM이면서 입력받은 계좌의 은행이 primary bank가 아닐 때 cout << "[ERROR] Invalid Card: the ATM is a single bank atm, and the " "card's bank is not the primary bank" << endl; return false; } // REQ3.3 사용자가 비밀번호를 입력하게하여 맞는지 확인 ( bank로 정보 넘겨서 // 확인받음 ) R EQ3.4 비밀번호 틀렸으면 -> display error message cout << "Insert password: "; cin >> password; cout << endl; int count = 0; while ((current_bank->verifyPassword(current_acc, password)) != true) { cout << "[ERROR] Incorrect Password" << endl; count++; // REQ3.5 연속으로 3번 틀리면 session 끝나야함 if (count == 3) { cout << "Incorect Password 3 times in a row..." << endl; return false; // 여기선 비밀번호 틀림... -> end session } // 비밀번호 입력 횟수 3번 미만이면 다시 비밀번호 입력받음 cout << "Insert password: "; cin >> password; cout << endl; } return true; // 여기선 비밀번호 맞음... } // 4. Deposit void ATM::deposit() { int deposit_type; // 1 for cash deposit, 2 for check deposit int deposit_amount; // deposit 장수 int total_deposit; // deposit 총액 int cash_limit = 30; int check_limit = 50; int deposit_1000; int deposit_5000; int deposit_10000; int deposit_50000; // REQ4.1 현금/수표 입력받음 cout << "What are you depositing?"; cout << "1.cash deposit\t2.check deposit\t3. Exit" << endl; cin >> deposit_type; cout << endl; // cash deposit 선택함 if (deposit_type == 1) { cout << "How much do you want to deposit?" << endl; cout << "Insert the amount of 1000won cash: " << endl; cin >> deposit_1000; cout << endl; cout << "Insert the amount of 5000won cash: " << endl; cin >> deposit_5000; cout << endl; cout << "Insert the amount of 10000won cash: " << endl; cin >> deposit_10000; cout << endl; cout << "Insert the amount of 50000won cash: " << endl; cin >> deposit_50000; cout << endl; deposit_amount = deposit_1000 + deposit_5000 + deposit_10000 + deposit_50000; total_deposit = deposit_1000 * 1000 + deposit_5000 * 5000 + deposit_10000 * 10000 + deposit_50000 * 50000; // REQ4.2 개수 제한 넘으면 display error message if (deposit_amount > cash_limit) { cout << "[ERROR] Your deposit amount is over 30(cash deposit limit)." << endl; return; // !!! 에러 발생하면 바로 반환되는가, 아니면 while loop 이용해서 // 다시 입력받는가.. } // REQ4.4 이체 수수료 부과될 수 있음 ( non - primary bank deposit일 때) if ((this->serial_type == 2) && (current_acc->getBankName() != serial_primary_bank->getBankName())) { cout << "You are charged for deposit fee of 1000won." << endl; total_deposit -= 1000; } // REQ4.3 현금/수표 accept됨 -> 은행 계좌에 거래 결과 반영 // 계좌 잔액에 총 예금액 더해주는 Bank 클래스 함수 current_bank->setDeposit(this->current_acc, total_deposit); // REQ4.5 현금 -> ATM 기기의 available cash 늘어남 num_of_1000 += deposit_1000; num_of_5000 += deposit_5000; num_of_10000 += deposit_10000; num_of_50000 += deposit_50000; } // check deposit 선택함 else if (deposit_type == 2) { cout << "How much do you want to deposit?" << endl; cout << "Insert the amount of check: " << endl; cin >> deposit_amount; cout << endl; cout << "Insert the amount of money: " << endl; // 정확히 얼마짜리 수표가 몇장 들어왔는지도 입력되어야함… cin >> total_deposit; // 일단 임시로 총 금액 입력받는걸 가정 cout << endl; // REQ4.2 개수 제한 넘으면 display error message if (deposit_amount > check_limit) { cout << "[ERROR] Your deposit amount is over 50(check deposit limit)." << endl; return; } // REQ4.4 이체 수수료 부과될 수 있음 (non-primary bank로 deposit 할 때) if ((this->serial_type == 2) && (current_acc->getBankName() != serial_primary_bank->getBankName())) { cout << "You are charged for deposit fee of 1000won." << endl; total_deposit -= 1000; } // REQ4.3 현금/수표 accept됨 -> 은행 계좌에 거래 결과 반영 // 계좌 잔액에 총 예금액 더해주는 Bank 클래스 함수 current_bank->setDeposit(this->current_acc, total_deposit); // REQ4.6 수표 -> available cash 변화x } // Exit 선택함 else if (deposit_type == 3) { EndSession(); return; } // Exception handling else { cout << "[ERROR] You must choose from 1 to 3." << endl; deposit(); return; } cout << "Success! You have deposited " << total_deposit << " won to your account." << endl; cout << endl; cout << "The remaining balance in your " << current_bank->getBankName() << " account " << current_acc->getAccountNum(); cout << " is " << current_acc->getBalance() << " won" << endl; cout << endl; cout << "The remaining 1000 in ATM : " << num_of_1000 * 1000 << endl; cout << "The remaining 5000 in ATM : " << num_of_5000 * 5000 << endl; cout << "The remaining 10000 in ATM : " << num_of_10000 * 10000 << endl; cout << "The remaining 50000 in ATM : " << num_of_50000 * 50000 << endl; cout << endl; } // 5. Withdrawal void ATM::withdrawal() { // check는 withdrawal 불가능 int withdrawal_amount; // deposit 장수 int total_withdrawal; // deposit 총액 int cash_limit = 30; int denominationOfBills; // 지폐 종류 int wrong_input = 0; // 틀린 입력일 때 종료를 위한 변수 int sumOfWithdrawal = 0; int withdrawal_1000 = 0; int withdrawal_5000 = 0; int withdrawal_10000 = 0; int withdrawal_50000 = 0; int fund; // 각 session 당 withdrawal 횟수는 3회까지 if (count != 3) { // REQ5.1 An ATM shall ask a user to enter the amount of fund to withdra cout << "Insert the amount of cash you want to withdrawal." << endl; cout << "What denomination of bills would you like to withdraw? (1,000 " "won, 5,000 won, 10,000 won, 50,000 won)" << endl; cout << "please input 1000, 5000, 10000, 500000...: "; cin >> denominationOfBills; cout << endl; if (denominationOfBills == 1000) { cout << "How many bills of would you like to withdraw?" << endl; cout << "please input 1000, 2000, 3000...: "; cin >> sumOfWithdrawal; cout << endl; if (sumOfWithdrawal % 1000 == 0) { withdrawal_1000 = sumOfWithdrawal / 1000; } else { cout << "[Error] Please input the correct amount of bills that you " "want to withdrawal." << endl; wrong_input = 1; } } else if (denominationOfBills == 5000) { cout << "How many bills of would you like to withdraw?" << endl; cout << "please input 5000, 10000, 15000...: "; cin >> sumOfWithdrawal; cout << endl; if (sumOfWithdrawal % 5000 == 0) { withdrawal_5000 = sumOfWithdrawal / 5000; } else { cout << "[Error] Please input the correct amount of bills that you " "want to withdrawal." << endl; wrong_input = 1; } } else if (denominationOfBills == 10000) { cout << "How many bills of would you like to withdraw?" << endl; cout << "please input 10000, 20000, 30000...: "; cin >> sumOfWithdrawal; cout << endl; if (sumOfWithdrawal % 10000 == 0) { withdrawal_10000 = sumOfWithdrawal / 10000; } else { cout << "[Error] Please input the correct amount of bills that you " "want to withdrawal." << endl; wrong_input = 1; } } else if (denominationOfBills == 50000) { cout << "How many bills of would you like to withdraw?" << endl; cout << "please input 50000, 100000, 150000...: "; cin >> sumOfWithdrawal; cout << endl; if (sumOfWithdrawal % 50000 == 0) { withdrawal_50000 = sumOfWithdrawal / 50000; } else { cout << "[Error] Please input the correct amount of bills that you " "want to withdrawal." << endl; wrong_input = 1; } } else { cout << "[Error] Please input the correct denomination of bills" << endl; wrong_input = 1; } // REQ5.2 An ATM shall display an appropriate error message if there is // insufficient fund in the account or insufficient cash in the ATM. if (num_of_1000 < withdrawal_1000 || num_of_5000 < withdrawal_5000 || num_of_10000 < withdrawal_10000 || num_of_50000 < withdrawal_50000) { cout << "[Error] There is not enough money in the ATM" << endl; cout << endl; } // ATM에 돈이 충분하지 않다면 Error 출력 else if (current_acc->getBalance() < sumOfWithdrawal) { cout << "[Error] There is not enough money in your account" << endl; cout << endl; } // REQ 5.7 The maximum amount of cash withdrawal per transaction is KRW // 500,000. else if (500000 < sumOfWithdrawal) { cout << "[Error] Withdrawals over 500,000 won are not allowed" << endl; cout << endl; } else if (wrong_input == 1) { cout << endl; } // REQ5.3 Once the withdrawal is successful, the transaction must be // reflected to the bank account // as well(i.e., the same amount of fund must be deducted from the // corresponding bank account). REQ5.5 The cash withdrawal lower available // cash in the ATM that can be used by other users. else { // REQ5.4 Some withdrawal fee may be charged(See REQ in System Setup). if (withdrawal_fee() == true) { // 수수료 낼 수 있으면 // ATM에서 돈 빼기 num_of_1000 = num_of_1000 - withdrawal_1000; num_of_5000 = num_of_5000 - withdrawal_5000; num_of_10000 = num_of_10000 - withdrawal_10000; num_of_50000 = num_of_50000 - withdrawal_50000; // 계좌에서 돈 빼기 current_bank->setWithdrawal(this->current_acc, sumOfWithdrawal); // 계좌/ATM에 남은 금액 출력 cout << "Success!" << endl; cout << endl; cout << "The remaining balance in your " << current_bank->getBankName() << " account is "; cout << current_acc->getBalance() << " won" << endl; cout << endl; cout << "The remaining 1000 in ATM : " << num_of_1000 * 1000 << endl; cout << "The remaining 5000 in ATM : " << num_of_5000 * 5000 << endl; cout << "The remaining 10000 in ATM : " << num_of_10000 * 10000 << endl; cout << "The remaining 50000 in ATM : " << num_of_50000 * 50000 << endl; cout << endl; } else { // 너 수수료 낼 돈 없어,, cout << "[Error] There is not enough money in your account" << endl; cout << endl; } } } else { cout << "[Error] If you want more withdrawal, Please restart session" << endl; cout << endl; } } bool ATM::withdrawal_fee() { // Withdrawal fee for a primary bank: KRW 1,000; the fee is paid from the // withdrawal account. if (current_bank == serial_primary_bank) { if (current_acc->getBalance() < 1000) { // 수수료가 통장에 없는 경우 return false; } else { current_bank->setWithdrawal(this->current_acc, 1000); // 1000원 수수료 // ATM에 수수료 추가 num_of_1000 = num_of_1000 + 1; return true; } } else { if (current_acc->getBalance() < 2000) { return false; } else { current_bank->setWithdrawal(this->current_acc, 2000); // 2000원 수수료 // ATM에 수수료 추가 num_of_1000 = num_of_1000 + 2; return true; } } } // 6. transfer void ATM::transfer() { // destination이 보낼 account // source이 현재 account int transfer_type; // cash or account 이체 int total_transfer; // 이체 될 금액 (이건 수수료 포함 X) double destination_acc_num; int transfer_fee; Bank *destination_bank; Account *destination_acc; // REQ 6.1 cash transfer / account fund transfer 중 transfer type 입력받음 cout << "What is your transfer type? "; cout << "1.cash transfer\t2.account transfer\t3. Exit : "; cin >> transfer_type; cout << endl; // REQ 6.2 이체해주려는 destination account number 입력받음 cout << "What is destination account number? : "; cin >> destination_acc_num; cout << endl; for (int i = 0; i < 10; i++) { // bank_list가 10개라서 이케함, len 따로 구해도 됨 destination_acc = Bank::bank_list[i]->findAccount(destination_acc_num); if (destination_acc != nullptr) { // 찾으면 break destination_bank = Bank::bank_list[i]; break; } } // cash transfer 선택함 // REQ 6.3. if cash transfer → 수수료 포함한 현금 입력받고 이체 금액 맞는지 // 확인 후 수수료 제외 나머지 금액 이체 // Cash transfer fee to any bank type: KRW 5,000; the fee is paid by inserting // additional cash. if (transfer_type == 1) { int transfer_1000; int transfer_5000; int transfer_10000; int transfer_50000; string confirmed_fee; int transfer_amount; cout << "How much do you want to tranfer?" << endl; cout << "Insert the amount of 1000 won cash: "; cin >> transfer_1000; cout << endl; cout << "Insert the amount of 5000 won cash: "; cin >> transfer_5000; cout << endl; cout << "Insert the amount of 10000 won cash: "; cin >> transfer_10000; cout << endl; cout << "Insert the amount of 50000 won cash: "; cin >> transfer_50000; cout << endl; cout << "The fee is 5,000 won (If confirmed, please press Y) : "; cin >> confirmed_fee; cout << endl; total_transfer = transfer_1000 * 1000 + transfer_5000 * 5000 + transfer_10000 * 10000 + transfer_50000 * 50000; // REQ 6.6. if cash transfer → available cash 늘어남 // ATM에 돈 추가 num_of_1000 += transfer_1000; num_of_5000 += transfer_5000 + 1; // 수수료 증가 num_of_10000 += transfer_10000; num_of_50000 += transfer_50000; // 계좌로 돈 이체 destination_bank->setTransfer(destination_acc, total_transfer); } else if (transfer_type == 2) { // account transfer /* source account number 새로 입력받는가 or 현재 카드 사용할것인지 물어보고 넘어가는가????????? double source_acc_num; Account* source_acc; Bank* source_bank; */ int check_source; cout << "Is your source account number " << current_acc->getAccountNum() << "?" << endl; cout << "Insert only number -> 1.Yes\t2.No : "; cin >> check_source; cout << endl; if (check_source == 2) { cout << "ERROR ???? " << endl; EndSession(); return; } cout << "How much do you want to tranfer?" << endl; cin >> total_transfer; cout << endl; // REQ 6.5. 이체 수수료 부과될 수 있음 (system setup 확인) bool destination_primary = (destination_bank->getBankName() == serial_primary_bank->getBankName()) ? true : false; bool source_primary = (current_bank->getBankName() == serial_primary_bank->getBankName()) ? true : false; if (destination_primary && source_primary) { // both primary banks transfer_fee = 2000; } else if (destination_primary || source_primary) { // primary and non-primary banks transfer_fee = 3000; } else { // both non-primary banks transfer_fee = 4000; } cout << "The transfer fee of " << transfer_fee << " won will be excluded from your account." << endl; //(REQ 6.7.) 이체 끝나면 잔액 변화 (있다면 source account,) destination account에 반영됨 // -> the same amount of fund must be deducted from the source bank account,and then added to the destination bank account destination_bank->setTransfer(destination_acc, total_transfer); current_bank->setWithdrawal(current_acc, total_transfer+transfer_fee); } // Exit 선택함 else if (transfer_type == 3) { EndSession(); return; } // Exception handling else { cout << "[ERROR] You must choose from 1 to 3." << endl; transfer(); return; } cout << "Success! You have transferred " << total_transfer << " won to account " << destination_acc_num; cout << endl; if (transfer_type == 2) { // account transfer일 경우에 transfer 마치고 다음 것 출력 cout << "with account transfer." << endl; cout << "The remaining balance of the source account " << current_bank->getBankName() << " account "; cout << current_acc->getAccountNum() << " is " << current_acc->getBalance() << " won" << endl; cout << "The remaining balance of the destinaton account " << destination_bank->getBankName() << " account "; cout << destination_acc->getAccountNum() << " is " << destination_acc->getBalance() << " won" << endl; } else if (transfer_type == 1) { // cash transfer일 경우에 transfer 마치고 다음 것 출력 cout << "with cash transfer." << endl; cout << "The remaining 1000 in ATM : " << num_of_1000 * 1000 << endl; cout << "The remaining 5000 in ATM : " << num_of_5000 * 5000 << endl; cout << "The remaining 10000 in ATM : " << num_of_10000 * 10000 << endl; cout << "The remaining 50000 in ATM : " << num_of_50000 * 50000 << endl; cout << destination_acc->getAccountNum() << " is " << destination_acc->getBalance() << " won" << endl; cout << "The remaining balance in your " << destination_bank->getBankName() << " account "; } cout << endl; } //---------main--------- int main() { cout << "Start making Banks" << endl; Bank *kakao = new Bank("Kakao"); Bank *daegu = new Bank("Daegu"); cout << endl; cout << "Start making Accounts" << endl; Account *a1 = new Account("Kakao", "David", 111111111111, 1004, 5000); kakao->setAccount(a1); Account *a2 = new Account("Daegu", "Jane", 222222222222, 1234, 50000); daegu->setAccount(a2); Account *a3 = new Account("Kakao", "Kate", 333333333333, 2435, 5000); kakao->setAccount(a3); cout << endl; cout << "Start making ATMS" << endl; ATM *atm1 = new ATM(kakao, 111111, "Single Bank", "Unilingual", 5, 0, 0, 0); ATM *atm2 = new ATM(daegu, 222222, "Multi Bank", "Bilingual", 0, 1, 0, 0); ATM *atm3 = new ATM(daegu, 333333, "Multi Bank", "Bilingual", 0, 1, 0, 0); cout << endl; kakao->printAllAccounts(); cout << endl; daegu->printAllAccounts(); cout << endl; cout << "num of banks: " << Bank::num_of_bank << endl; for (int i = 1; i < Bank::num_of_bank; i++) { cout << "Bank #" << i << " : " << Bank::bank_list[i]->getBankName() << endl; } cout << endl; cout << "num of ATMs: " << Bank::num_of_atm << endl; for (int i = 1; i < Bank::num_of_atm; i++) { cout << "ATM #" << i << " : " << Bank::atm_list[i]->serial_num << endl; } cout << endl; atm2->StartSession(Bank::bank_list); return 0; /* 222222222222 */ }