Question: The following is an example of a main program you can choose to use which meets the above requirements: #include #include #include savingsAccount.h #include checkingAccount.h

 The following is an example of a main program you canchoose to use which meets the above requirements: #include #include #include "savingsAccount.h"

The following is an example of a main program you can choose to use which meets the above requirements:

#include

#include

#include "savingsAccount.h"

#include "checkingAccount.h"

using namespace std;

int main()

{

bankAccount *accountsList[6];

accountsList[0] = new checkingAccount("Bill", 10200, 25000,100,0.012,10.00);

accountsList[1] = new checkingAccount("Bob", 10210, 10000,100,0.0099,15.00);

accountsList[2] = new savingsAccount("Susan", 90001, 20000,0.031);

accountsList[3] = new savingsAccount("Steve", 90002, 50000,0.041);

accountsList[4] = new checkingAccount("Sally", 10220, 4999,100,0.0079,20.00);

accountsList[5] = new savingsAccount("Frad", 90003, 2000,0.011);

cout

for (int i = 0; i

{

accountsList[i]->createMonthlyStatement();

accountsList[i]->print();

cout

}

cout

for (int i = 0; i

{

accountsList[i]->createMonthlyStatement();

accountsList[i]->print();

cout

}

for (int i = 0; i

{

accountsList[i]->withdraw(500);

}

cout

for (int i = 0; i

{

accountsList[i]->createMonthlyStatement();

accountsList[i]->print();

cout

}

return 0;

}

Output can look similar to this:

January:

-------------

Interest Checking ACCT#: 10200 balance : $25290.00 Interest Rate = 1.20%

Interest Checking ACCT#: 10210 balance : $10089.00 Interest Rate = 0.99%

Savings ACCT#: 90001 balance : $20620.00 Interest Rate = 3.10%

Savings ACCT#: 90002 balance : $52050.00 Interest Rate = 4.10%

Interest Checking ACCT#: 10220 balance : $5028.49 Interest Rate = 0.79%

Savings ACCT#: 90003 balance : $2022.00 Interest Rate = 1.10%

February:

-------------

Interest Checking ACCT#: 10200 balance : $25583.48 Interest Rate = 1.20%

Interest Checking ACCT#: 10210 balance : $10178.88 Interest Rate = 0.99%

Savings ACCT#: 90001 balance : $21259.22 Interest Rate = 3.10%

Savings ACCT#: 90002 balance : $54184.05 Interest Rate = 4.10%

Interest Checking ACCT#: 10220 balance : $5058.22 Interest Rate = 0.79%

Savings ACCT#: 90003 balance : $2044.24 Interest Rate = 1.10%

March:

-------------

Interest Checking ACCT#: 10200 balance : $25374.48 Interest Rate = 1.20%

Interest Checking ACCT#: 10210 balance : $9764.70 Interest Rate = 0.99%

Savings ACCT#: 90001 balance : $21402.76 Interest Rate = 3.10%

Savings ACCT#: 90002 balance : $55885.10 Interest Rate = 4.10%

Interest Checking ACCT#: 10220 balance : $4584.23 Interest Rate = 0.79%

Savings ACCT#: 90003 balance : $1561.23 Interest Rate = 1.10%

You will create seven files for this assignment:

bankAccount.h (base class definition)

bankAccount.cpp (base class implementation)

checkingAccount.h (checkingAccount definition)

checkingAccount.cpp (checkingAccount implementation)

savingsAccount.h (savingsAccount definition)

savingsAccount.cpp (savingsAccount implementation)

bankAccountTest.cpp (test file for your bankAccount class)

bankAccount polymorphism Create from scratch or modify week 2 program as follows. bankAccount - The bankAccount class will be abstract in this assignment and will use virtual and ata, just make up values). Perform these steps in order: 7. withdraw 500 for each account 8. print a match header 9. for all 6 accounts, create the monthly statement then print the account info

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!