/* Name: intcheck.cpp * Purpose: Implementation File for Bank Interest Checking Account Class * Author: Dr. Michael A. Redmond * Date Written: 05/04/98 * Date Revised: * NOTES: */ // in intcheck.h #include "account.h" #include "checking.h" #include "intcheck.h" IntChecking::IntChecking() : Checking(), IntYTD(0) { } // bal defaults to 0.0 // currNumChecks defaults to 0 // interestToDate defaults to 0 IntChecking::IntChecking(const string& numb, double bal, int currNumChecks, double interestToDate) : Checking(numb,bal,currNumChecks), IntYTD(interestToDate) { } double IntChecking::ProcessMonthEnd() { double interest = 0; if (lowestBalanceThisMonth >= minBalForInt) { interest = GetBal() * (IntPct / 12); Deposit(interest); } if (lowestBalanceThisMonth < minBal) { double charge = numChecksWritten * perCheckCharge; Withdraw(charge); } IntYTD = IntYTD + interest; return GetBal(); } double IntChecking::GetIntYTD() { return IntYTD; }