/* BankAccount.cpp CIS 250 2013-03-14 David Klick modified by: date: This is the implementation file for the BankAccount class for the Bank Account assignment. */ #include "BankAccount.h" // initialize the static int data member void BankAccount::init(const char* accnum, const double bal) { // initialize the accountNumber and balance data members // update count } BankAccount::BankAccount(const char* accnum, const double bal) { // use init to initialize a new BankAccount object } BankAccount::BankAccount(const BankAccount& ba) { // use init to initialize a new BankAccount object } BankAccount::~BankAccount() { // free memory held by accountNumber if applicable // update the count } const BankAccount& BankAccount::operator=(const BankAccount& ba) { // implement the assignment operator return *this; } const char* BankAccount::getAccountNumber() const { return accountNumber; } double BankAccount::getBalance() const { return balance; } void BankAccount::setAccountNumber(const char* accnum) { // set accountNumber, making sure to release old // memory if applicable, allocate just the amount of memory // you need for the new account number, and set the new // account number to a zero-length string if the // argument sent in is NULL } void BankAccount::withdraw(const double amt) { balance -= amt; } void BankAccount::deposit(const double amt) { balance += amt; } int BankAccount::getCount() { return count; } std::ostream& operator<<(std::ostream& strm, const BankAccount& ba) { strm << "Bank account: " << ba.accountNumber << ", Balance: $" << std::fixed << std::showpoint << std::setprecision(2) << ba.balance; return strm; }