Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the Following : Interface: 1. Create an interface called Account, which contains the following methods: deposit( ) debit( ) transFeeAction( ) Abstract : Create
Create the Following :
Interface:
1. 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
2. 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 Assistance is low priority and TypeOfAccount is:
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 Assistance is high priority and TypeOfAccount is:
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 abstract class
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started