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
|
#include "stdafx.h"
#include <iostream>
#include "Account.h"
#include "Transaction.h"
#include "Deposit.h"
#include "Withdrawal.h"
#include "BalanceInquiry.h"
#include <iostream>
using namespace std;
int main()
{
Deposit *dpTrans[5];
Withdrawal *wdTrans[5];
Account *acct[5];
acct[0] = new Account(100001, 6350.00, "James L. Hetherington");
acct[1] = new Account(100006, 0.00, "Eleanor M. Hastings");
acct[2] = new Account(100007, 55.90, "Caleb J. Roth");
acct[3] = new Account(100012, 354.19, "Rhonda Marie Sims");
acct[4] = new Account(100023, 8842.67, "Arthur Crawford Broan");
for (int i = 0; i < 5; i++)
{
acct[i]->display();
}
for (int i = 0; i < 5; i++)
{
dpTrans[i] = new Deposit;
wdTrans[i] = new Withdrawal;
}
dpTrans[0]->execute(acct[0], 550);
dpTrans[1]->execute(acct[1], 259.67);
dpTrans[2]->execute(acct[2], 411.19);
dpTrans[3]->execute(acct[3], 245.81);
dpTrans[4]->execute(acct[4], 1157.33);
BalanceInquiry inquiry;
inquiry.execute(acct[02]);
inquiry.execute(acct[04]);
wdTrans[0]->execute(acct[0], 200);
wdTrans[1]->execute(acct[1], 100);
wdTrans[2]->execute(acct[2], 350);
wdTrans[3]->execute(acct[3], 1);
wdTrans[4]->execute(acct[4], 2500);
cout << endl;
for (int i = 0; i < 5; i++)
{
acct[i]->display();
}
cout << endl;
system("pause");
return 0;
}
|