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 BankAccount class.

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 and CurrentAccount are derived classes. With the SavingAccount, the Bank pays interest 4% each Year to the customer based on the account balance. With the CurrentAccount, the Bank subtracts 1 JD as charges for each withdraw transaction.

1. Initialise a SavingAccount and CurrentAccount objects with an initial balance 100JD.

2. Write the code of CalculateInterest function for the SavingAccount class. It should calculate the interest yearly and add it to the balance.

3. Write the code of TransactionCharge function for the CurrentAccount class. It should deduct 1JD from the balance after each withdraws transaction.

4. Create a FlexyAccount class that drived from SavingAccount and CurrentAccount.

5. create CalculateInterest function for the FlexyAccount class , knowing that the interest rate is 1%.

6. create TransactionCharge function for the FlexyAccount class , knowing that the charge for each 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.

C) Write a program (main) that will do the following:

1. create a BankAccount object with 1000 JD in Balance.

2. create a SavingAccount object with 400 JD in Balance.

3. create a CurrentAccount object with 2000 JD in Balance.

4. display the balance of SavingAccount object after one year, using PrintBank function.

5. display the balance of CurrentAccount object after 10 withdraw transactions, , using PrintBank function.

6. create a FlexyAccount object with 800 JD in Balance.

7. create a FlexyAccount object using a copy constructor.

8. display the balance of FlexyAccount object after 5 withdraw transactions performed during the last 3 months, , using PrintBank function.

Assignment 1 :https://www.chegg.com/homework-help/questions-and-answers/assignment-required-develop-program-allows-creation-viewing-storage-information-bank-accou-q62418029?trackid=a18357eac2ff&strackid=dc2ea5cd3f37

Assignment 2 :https://www.chegg.com/homework-help/questions-and-answers/using-c-class-bankaccount-private-int-id-string-firstname-string-surname-char-acctype-floa-q65735085?trackid=ftlBh7hA

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!