#include "Account.h" using namespace std; Account::Account():balance(0) //We are using scope resolution operator :: to show to the compiler and linker that we are implementing functions for a class Account, not any other class. { } //We are using initialization syntax: we are giving 0 values to variable balance //We do not need to initialize the vector of logs as it is initialized as empty one vector Account::Report() { vector report; report.push_back("Current Balance is " + to_string(balance)); report.push_back("Transactions: "); for (auto t : log) { report.push_back(t.Report()); } report.push_back("_______________"); return report; } bool Account::Deposit(int amt) { if (amt >= 0) { balance += amt; log.push_back(Transaction(amt, "Deposit")); return true; } else { return false; } } bool Account::Withdraw(int amt) { if (amt >= 0) { if (balance >= amt) { balance -= amt; log.push_back(Transaction(amt, "Withdraw")); return true; } else { return false; } } else { return false; } }