#include "BankAccount1.h" BankAccount::BankAccount() { balance = 0; // ... or implicitly } void BankAccount::deposit(float amount) { balance += amount; } void BankAccount::withdraw(float amount) { balance -= amount; } 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; return ss.str(); } SavingsAccount::SavingsAccount(float rate) { interestRate = rate; balance = 0; } void SavingsAccount::addInterest() { balance = balance * (1.0 + interestRate); }