Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

2. Enrolling employees in courses and programs.

Answered: 1 week ago

Question

Solve for x: 2(3x 1)2(x + 5) = 12

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago