#include "account.h" #include "checking.h" #include "intcheck.h" #include "savings.h" double Checking::minBal = 1000; double Checking::perCheckCharge = 0.05; double IntChecking::minBalForInt = 2000; double IntChecking::IntPct = 0.03; double Savings::IntPct = 0.05; int main() { char wait; Account x(); Account y("12345",0); y.Deposit(100); y.Withdraw(20); // cout << y.GetBal() << endl; cout << y << endl; cout << "WAIT>" << flush; cin >> wait; Checking a; a.Deposit(1000); cout << "a has balance: " << a.GetBal() << endl; a.Withdraw(20); cout << "a has balance: " << a.GetBal() << endl; cout << "a has balance: " << a.ProcessCheck(35) << endl; a.Deposit(500); cout << "a has balance: " << a.GetBal() << endl; cout << "a has balance: " << a.ProcessMonthEnd() << endl; //cout << "At month end, a has balance: " << a.GetBal() << endl; cout << "At month end, a: " << a << endl; cout << "WAIT>" << flush; cin >> wait; Checking b("98765",1000,0); b.Deposit(1000); cout << "b has balance: " << b.GetBal() << endl; b.Withdraw(20); cout << "b has balance: " << b.GetBal() << endl; cout << "b has balance: " << b.ProcessCheck(35) << endl; b.Deposit(500); cout << "b has balance: " << b.GetBal() << endl; cout << "b has balance: " << b.ProcessMonthEnd() << endl; //cout << "At month end, b has balance: " << b.GetBal() << endl; cout << "At month end, b: " << b << endl; cout << "WAIT>" << flush; cin >> wait; IntChecking j; j.Deposit(1000); cout << "j has balance: " << j.GetBal() << endl; j.Withdraw(20); cout << "j has balance: " << j.GetBal() << endl; j.Deposit(500); cout << "j has balance: " << j.GetBal() << endl; cout << "j has balance: " << j.ProcessCheck(35) << endl; j.Deposit(500); cout << "j has balance: " << j.GetBal() << endl; cout << "j has balance: " << j.ProcessCheck(25) << endl; cout << "j has balance: " << j.ProcessCheck(55) << endl; cout << "j has balance: " << j.ProcessMonthEnd() << endl; //cout << "At month end, j has balance: " << j.GetBal() << endl; cout << "At month end, j: " << j << endl; cout << " j has received: " << j.GetIntYTD() << " in interest so far this year " << endl; cout << "WAIT>" << flush; cin >> wait; IntChecking k("98765",1000,0,0); k.Deposit(1000); cout << "k has balance: " << k.GetBal() << endl; k.Withdraw(20); cout << "k has balance: " << k.GetBal() << endl; k.Deposit(500); cout << "k has balance: " << k.GetBal() << endl; cout << "k has balance: " << k.ProcessCheck(35) << endl; k.Deposit(500); cout << "k has balance: " << k.GetBal() << endl; cout << "k has balance: " << k.ProcessCheck(25) << endl; cout << "k has balance: " << k.ProcessCheck(55) << endl; cout << "k has balance: " << k.ProcessMonthEnd() << endl; //cout << "At month end, k has balance: " << k.GetBal() << endl; cout << "At month end, k: " << k << endl; cout << " k has received: " << k.GetIntYTD() << " in interest so far this year " << endl; cout << "WAIT>" << flush; cin >> wait; IntChecking m("98765",2000,0,0); m.Deposit(1000); cout << "m has balance: " << m.GetBal() << endl; m.Withdraw(20); cout << "m has balance: " << m.GetBal() << endl; m.Deposit(500); cout << "m has balance: " << m.GetBal() << endl; cout << "m has balance: " << m.ProcessCheck(35) << endl; m.Deposit(500); cout << "m has balance: " << m.GetBal() << endl; cout << "m has balance: " << m.ProcessCheck(25) << endl; cout << "m has balance: " << m.ProcessCheck(55) << endl; cout << "m has balance: " << m.ProcessMonthEnd() << endl; //cout << "At month end, m has balance: " << m.GetBal() << endl; cout << "At month end, m: " << m << endl; cout << " m has received: " << m.GetIntYTD() << " in interest so far this year " << endl; cout << "WAIT>" << flush; cin >> wait; Savings r; r.Deposit(1000); cout << "r has balance: " << r.GetBal() << endl; r.Withdraw(20); cout << "r has balance: " << r.GetBal() << endl; r.Deposit(500); cout << "r has balance: " << r.GetBal() << endl; r.Withdraw(35); cout << "r has balance: " << r.GetBal() << endl; r.Deposit(500); cout << "r has balance: " << r.GetBal() << endl; r.Withdraw(25); cout << "r has balance: " << r.GetBal() << endl; r.Withdraw(55); cout << "r has balance: " << r.GetBal() << endl; cout << "r has balance: " << r.ProcessMonthEnd() << endl; //cout << "At month end, r has balance: " << r.GetBal() << endl; cout << "At month end, r: " << r << endl; cout << " r has received: " << r.GetIntYTD() << " in interest so far this year " << endl; cout << "WAIT>" << flush; cin >> wait; Savings s("98765",1000,0); s.Deposit(1000); cout << "s has balance: " << s.GetBal() << endl; s.Withdraw(20); cout << "s has balance: " << s.GetBal() << endl; s.Deposit(500); cout << "s has balance: " << s.GetBal() << endl; s.Withdraw(35); cout << "s has balance: " << s.GetBal() << endl; s.Deposit(500); cout << "s has balance: " << s.GetBal() << endl; s.Withdraw(25); cout << "s has balance: " << s.GetBal() << endl; s.Withdraw(55); cout << "s has balance: " << s.GetBal() << endl; cout << "s has balance: " << s.ProcessMonthEnd() << endl; //cout << "At month end, s has balance: " << s.GetBal() << endl; cout << "At month end, s: " << s << endl; cout << " s has received: " << s.GetIntYTD() << " in interest so far this year " << endl; cout << "WAIT>" << flush; cin >> wait; Savings t("98765",2000,0); t.Deposit(1000); cout << "t has balance: " << t.GetBal() << endl; t.Withdraw(20); cout << "t has balance: " << t.GetBal() << endl; t.Deposit(500); cout << "t has balance: " << t.GetBal() << endl; t.Withdraw(35); cout << "t has balance: " << t.GetBal() << endl; t.Deposit(500); cout << "t has balance: " << t.GetBal() << endl; t.Withdraw(25); cout << "t has balance: " << t.GetBal() << endl; t.Withdraw(55); cout << "t has balance: " << t.GetBal() << endl; cout << "t has balance: " << t.ProcessMonthEnd() << endl; //cout << "At month end, t has balance: " << t.GetBal() << endl; cout << "At month end, t: " << t << endl; cout << " t has received: " << t.GetIntYTD() << " in interest so far this year " << endl; return 0; }