1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include "bankAccount.h"
#include "SavingsAccount.h"
#include "HighInterestSavings.h"
#include "NoServiceChargeChecking.h"
#include "ServiceChargeChecking.h"
#include "HighInterestChecking.h"
#include "CertificateOfDeposit.h"
#include "checkingAccount.h"
using namespace std;
int main()
{
vector accountsList;
//SavingsAccount( Name, Account number, Balance ) - Assume an interest rate = 0.03
accountsList.push_back(new SavingsAccount("Bill", 10200, 2500));
//HighInterestSavings(Name, Account Number, Balance) -- Assume an interest rate = 0.05, Minimum balance = $2500
accountsList.push_back(new HighInterestSavings("Susan", 10210, 2000));
//NoServiceChargeChecking(Name, Account Number, Balance) -- Assume an interest rate = 0.02, Minimum balance = $1000
accountsList.push_back(new NoServiceChargeChecking("John", 20100, 3500));
//ServiceChargeChecking(Name, Account Number, Balance) -- Assume account service charge = $10, Maximum number of checks = 5, Service Charee Excess Number of Checks = $5
accountsList.push_back(new ServiceChargeChecking("Ravi", 30100, 1800));
//HighIntererestChecking(Name, Account Number, Balance) - Assume an inerest rate = 0.05, Minimum balance = $5000
accountsList.push_back(new HighInterestChecking("Sheila", 20200, 6000));
//Certificate(name, Account Number, Balance, Interest Rate, Number of Months) - Assume an initial interest rate = 0.05, Initial Number of Maturity Months = 6
accountsList.push_back(new CertificateOfDeposit("Hamid", 51001, 18000, 0.075, 18));
cout << "January:\n-------------" << endl;
for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->createMonthlyStatement();
accountsList[i]->print();
cout << endl;
}
cout << "\nFebruary:\n-------------" << endl;
for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->createMonthlyStatement();
accountsList[i]->print();
cout << endl;
}
for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->withdraw(500);
}
cout << "\nMarch:\n-------------" << endl;
for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->createMonthlyStatement();
accountsList[i]->print();
cout << endl;
}
system("pause");
return 0;
}
|