// File: savingAccount.cpp // implementation file for the savingAccount class #include "savingAccount.h" savingAccount::savingAccount(double bal, double pct) : account(bal) { rate = pct / 100.0; } double savingAccount::compound(void) { double interest = rate * balance; balance += interest; return interest; } double savingAccount::withdraw(double amt) { if (amt <= balance) { balance -= amt; return amt; } else return 0; }