Question: Interface: Create an interface called Account, which contains the following methods: deposit( ) debit( ) transFeeAction( ) Abstract : Create an abstract class named TypeAccount

Interface:

Create an interface called Account, which contains the following methods:

deposit( )

debit( )

transFeeAction( )

Abstract :

Create an abstract class named TypeAccount

Make the class inherit/implement this interface

Add the following attributes:

TypeOfAccount as String . This filed can be assigned one of the options: saving account , income accounts, business account

NumberOfAccounts as integer

TypeOfCard as String. This filed can be assigned one of the options: Black card, Debit cards ,Credit card.

Add getLaon(double colorectal) method and make it abstract

Take the default methods (deposit-debit-transFeeActions) from the client class and place it here

Create an abstract class named SpecialPrivilege

Make this class inherit the TypeAccount abstract class

Add the following attributes

TypeOfClient as String. This field can be assigned with either Normal or Golden Client.

Assistance as String. This filed can be assigned with either low or high priority.

Include the body of the getLaon() in this class. This method contains the following conditions :

If the account is low priority and:

an income account , then allow loan of 1000 Riyal

a saving account, then do not allow a loan until user provide a colorectal of the same amount

If the account is high priority and:

an income account, then allow loan of 50000 Riyal

a biasness account, then allow a loan of 40% revenue

Normal class:

Make the client class inherit the SpecialPrivilege interface

Override equal method, Only include comparison of 4 attributes :

ID

Name

TypeOfAccount

TypeOfClient

Override compareTo method, Only include comparison of 3 attributes :

TypeOfClient

TypeOfAccount

Balance

In the main class BankSystem

Add another normal client object that has the same name, id , and type account of one of the existing/previously created clients

Check if this object is equal to the one you created and print both objects are equal if this condition is satisfied

Create an array of clients and add all Golden and normal clients currently and previously created, then sort the array . Print the result before and after sorting.

please answer all

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!