#include "BankAccount.h" void BankAccount::initialise(std::string n) { this->name = n; // Can refer to members via this pointer... balance = 0; // ... or implicitly transactionCount = 0; } void BankAccount::deposit(float amount) { balance += amount; transactionCount++; } void BankAccount::withdraw(float amount) { balance -= amount; transactionCount++; } void BankAccount::transfer(BankAccount& to, float amount) { withdraw(amount); to.deposit(amount); } std::string BankAccount::report() { std::stringstream ss (std::stringstream::in | std::stringstream::out); ss << balance << " " << transactionCount; return name + " " + ss.str(); }