Question: Write a program to process bank accounts. Create a base class named Account and two derived classes named Savings and Checking. In the base class,

Write a program to process bank accounts. Create a base class named Account and two derived classes named Savings and Checking. In the base class, use an int AccountNum and a double balance for data members. Also, create an overloaded operator+= function to do deposit and an overloaded operator?= function to do withdraw. The printBalance function is created to print both savings and checking accounts. The account number of new account is automatically generated by the program beginning at account number one.

Hint for the test program:

int main( )

{

vector checking(50) ;

vector savings(50);

int accNumS = 0, accNumC = 0;

double bal = 0, amt = 0;

...

case 1:

cout

cin >> bal;

checking[accNumC] = new Checking(accNumC+1,bal);

accNumC++;

break;

...

case 3:

cout

cin >> acct;

cout

cin >> amt ;

(*checking[acct-1]) += amt;

break;

Problem Requirement

a) You must use a separate .h and .cpp files for each class.

b) You must use a separate file for the Testing program.

c) Your program must produce the prompt and the output the same as given.

d) The balances should be displayed with 2 decimal places.

Write a program to process bank accounts. Create a base class named

Account and two derived classes named Savings and Checking. In the base

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!