Question: PART B- OOP Bank transaction using Inheritance and Polymorphism Create a class and name it Account that a bank might use to represent the client

 PART B- OOP Bank transaction using Inheritance and Polymorphism Create a

PART B- OOP Bank transaction using Inheritance and Polymorphism Create a class and name it Account" that a bank might use to represent the client bank account. You must include an account number, the client name as String and a float data member to represent the balance inside that account. Add a default constructor that assigns a default account number, a default client name and an initial amount used to initialize the balance. Use setter and getter methods to set and get the balance. In addition, add a method to calculate the balance inside the account. Two derived classes "Debit Card" and "Credit Card" are created respectively where the calculated balance differs between the two classes. The "Debitcard" class has a double data member named debit which allows the client only to withdraw money from his balance (usually his monthly salary). On the other hand, the "Credit Card" class has two double data members debit and credit which allows the client either to withdraw money or to add money to his balance, as well as a monthly interest is added to his actual balance. In addition, you must use the appropriate setter and getter methods for both derived classes. Write a driver that will instantiates objects from these two derived classes and store it into an array of the super class type. The program must implement polymorphism to be able to call the appropriate method that calculates the current balance at run time with respect to the current object being in use. On the other hand, it will add 50$ to the balance of the customers who hold a "Creditcard

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!