Bank
Bank
withDrawAtDesk and depositAtDesk, boths have only parameter with double type.
IService has initial fields today (date type) set today value and method checkBalance (no parameter) will
return double value.
IUseIPay interface will have two methods iPay and internetBanking, boths have only parameter with
double type. Besides it also extends IService
Account object has id (string type), name (string type) and balance (double type). Student should
implement all constructors, getters, setters. Moreover, default constructor (no parameter) will set id,
name is “Empty”, and balance is zero
SimpleAccount class inherites Account and implement IBank. It also owns type (as string). In default
constructor, it should set type is “1”. You override withDrawAtDesk by checking an input parameter “x”
as following conditions: x >= 0 && x < 1000 then checking balance - x - 5.0 >= 5.0 then balance =
balance-x-5.0. Besides depositAtDesk: input parameter x >= 0 and x < 10000 then balance = balance+x
MembershipAccount class will inherite SimpleAccount and implement IService. In default constructor, it
should set type is “2”. You will be charged 5.0 when calling checkBalance service and return balance. The
toString method will be format as:
VIPAccount class will inherite Account and implement IBank, IUseIPay. You should implement some
method as follows
withDrawAtDesk: input parameter x >=0 then if balance - x - 1.0 >= 5.0 then balance = balance-x-1.0
checkBalance: you will be charged 1.0 when calling checkBalance service and return balance.
internetBanking: will inform that you use service “Internet banking delegates for desk helper” then
checking input parameter x. If x >= 0 then calling depositAtDesk otherwise calling withDrawAtDesk with
absolute value of x
iPay: will inform that you use service “iPay delegates for internet service helper” then calling
internetBanking service