int main() { Account *account = new Account("Jim Johnson"); account->Deposit(500.0); account->Deposit(300.0); account->Deposit(550.0); account->PayInterest(); account->Withdraw(2000.0); account->Withdraw(1100.0); return 0; }
void WithdrawlOrder::Execute(BSTree &accounts) { Account* temp; if (accounts.Retrieve(accountID, temp)) { temp->Withdraw(amount, fundNumber); } else { cerr << "ERROR: Account " << accountID << " not found. Withdrawl refused." << endl; } }
void Bank::Withdraw(const Transaction& tr) { Account info; Account* result = NULL; string acc = tr.GetAccount(); string num = acc.substr(0, acc.length() - 1); info.SetNumber(num); if (!tree.Retrieve(info, result)) { cerr << "ERROR: Account " << num << " not found. Withdraw refused." << endl; return; } result->Withdraw(tr); }