Question: A) Using the class BankAccount' defined in the assignment 2, modify it according to the following: 1. Remove data member Bank Account Type (Current Account,

A) Using the class BankAccount' defined in the assignment 2, modify it according to the following: 1. Remove data member "Bank Account Type (Current Account, Savings Account)" from the Ban kAccount dass. 2. Modify the parameterized constructor to take balance as argument. 3. Add copy contractor. B) Create an inheritance hierarchy where "BankAccount" is the base class and "SavingAccount" an d "Current Account" are derived classes. With the SavingAccount, the Bank pays interest 4% cach Year to the customer based on the account balance. With the CurrentAccount the Bank subtract $1 JD as charges for each withdraw transaction. 1. Initialise a SavingAccount and Current Account objects with an initial balance 100JD 2. Write the code of 'CalculateInterest' function for the SavingAccount class. It should calculatet he interest yearly and add it to the balance 3. Write the code of Transaction Charge function for the Current Account class. It should deduct 1 JD from the balance after each withdraws transaction. 4. Create a "FlexyAccount" class that drived from SavingAccount and Current Account 5. create 'CalculateInterest' function for the FlexyAccount class, knowing that the interest rate is 1% 6 create Transaction Charge function for the FlexyAccount class, knowing that the charge for e ach withdraw transaction is 0.5 JD. 7 Write the appropriate code for the destructor of each derived class. 8. Write the code of 'PrintBank function for each derived class. A) Using the class BankAccount' defined in the assignment 2, modify it according to the following: 1. Remove data member "Bank Account Type (Current Account, Savings Account)" from the Ban kAccount dass. 2. Modify the parameterized constructor to take balance as argument. 3. Add copy contractor. B) Create an inheritance hierarchy where "BankAccount" is the base class and "SavingAccount" an d "Current Account" are derived classes. With the SavingAccount, the Bank pays interest 4% cach Year to the customer based on the account balance. With the CurrentAccount the Bank subtract $1 JD as charges for each withdraw transaction. 1. Initialise a SavingAccount and Current Account objects with an initial balance 100JD 2. Write the code of 'CalculateInterest' function for the SavingAccount class. It should calculatet he interest yearly and add it to the balance 3. Write the code of Transaction Charge function for the Current Account class. It should deduct 1 JD from the balance after each withdraws transaction. 4. Create a "FlexyAccount" class that drived from SavingAccount and Current Account 5. create 'CalculateInterest' function for the FlexyAccount class, knowing that the interest rate is 1% 6 create Transaction Charge function for the FlexyAccount class, knowing that the charge for e ach withdraw transaction is 0.5 JD. 7 Write the appropriate code for the destructor of each derived class. 8. Write the code of 'PrintBank function for each derived class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
