Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Given the class Bank below: class Bank { private: int BankID; string BankName; BankAccount *AccBanks; public: Bank(); Bank(); void AddAcc (); // to add

image text in transcribed

c++

Given the class Bank below: class Bank { private: int BankID; string BankName; BankAccount *AccBanks; public: Bank(); Bank(); void AddAcc (); // to add new account to the array of accounts void DeleteAcc() // to Delete new account to the array of accounts void PrintBank(); 2/2 PSUT a) Modify the class according to the following: 1. Initialise a Bank object with an array of 5 Bank accounts. 2. Write the appropriate code for the destructor. 3. Write the code of 'AddAcc' and 'DeleteAcc' functions. 4. Write the code of 'PrintBank' function using the 'print' function of class BankAccount. 5. Write the code of 'Optimization' function to shrink size of array. 6. Implement a friend function 'DispNumAcc' that display the 'TotalNumberOfAcc' data member. b) Write a program (main) that will do the following: 1. Define an array of 3 Banks. 2. For each Bank: Fill the BankAccount array from the user until all Bank accounts are full. 3. Print the contents of all Banks to the screen. 4. Create a BankAccount object and read the values from the user to fill it, and add it to the corresponding Bank. 5. Let the user enter a 'First Name' and 'Last name of the account owner and delete the corresponding BankAccount from the Bank(s). Make sure that the deletion doesn't create a gap in the array of BankAccount. 6. Delete any unused memory using 'Optimization' function. 7. Display the Total number of accounts in the screen using 'DispNumAcc' function. Given the class Bank below: class Bank { private: int BankID; string BankName; BankAccount *AccBanks; public: Bank(); Bank(); void AddAcc (); // to add new account to the array of accounts void DeleteAcc() // to Delete new account to the array of accounts void PrintBank(); 2/2 PSUT a) Modify the class according to the following: 1. Initialise a Bank object with an array of 5 Bank accounts. 2. Write the appropriate code for the destructor. 3. Write the code of 'AddAcc' and 'DeleteAcc' functions. 4. Write the code of 'PrintBank' function using the 'print' function of class BankAccount. 5. Write the code of 'Optimization' function to shrink size of array. 6. Implement a friend function 'DispNumAcc' that display the 'TotalNumberOfAcc' data member. b) Write a program (main) that will do the following: 1. Define an array of 3 Banks. 2. For each Bank: Fill the BankAccount array from the user until all Bank accounts are full. 3. Print the contents of all Banks to the screen. 4. Create a BankAccount object and read the values from the user to fill it, and add it to the corresponding Bank. 5. Let the user enter a 'First Name' and 'Last name of the account owner and delete the corresponding BankAccount from the Bank(s). Make sure that the deletion doesn't create a gap in the array of BankAccount. 6. Delete any unused memory using 'Optimization' function. 7. Display the Total number of accounts in the screen using 'DispNumAcc' function

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

Step: 3

blur-text-image

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions