Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ A) Using the class Bank Account defined in the assignment 2 modify it according to the following: 1. Remove data member Bank Account

image text in transcribedin c++
A) Using the class Bank Account defined in the assignment 2 modify it according to the following: 1. Remove data member "Bank Account Type (Current Account, Savings Account)" from the Bank Account class. 2. Modify the parameterized constructor to take balance as argument 3. Add copy contractor B) Create an inheritance hierarchy where "Bank Account" 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 Current Account, the Bank subtracts 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 calculate the interest yearly and add it to the balance. 3. Write the code of 'TransactionCharge function for the Current Account class. It should deduct IJD from the balance after each withdraws transaction. 4. Create a "Flexy Account" class that drived from Saving Account and Current Account S.create "CalculateInterest' function for the Flexy Account class, knowing that the interest rate is 1%. 6. create TransactionCharge function for the Flexy Account 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 Bank Account 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 Current Account object after 10 withdraw transactions, using PrintBank function 6. create a Flexy Account object with 800 JD in Balance 7.create a Flexy Account object using a copy constructor. 8. display the balance of Flexy Account object after 5 withdraw transactions performed during the last 3 months, using PrintBank function Note that you should separate the interface form the implementation for all of your code

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

More Books

Students also viewed these Databases questions