Question: * Interface Comparable +compareTo (E obj): int Interface Closable +isclosable (): boolean has Bank -accounts: BankAccount [] -count: int +Bank (String filename) -readAccounts (String

* "Interface" Comparable +compareTo (E obj): int "Interface" Closable +isclosable (): booleanhas Bank -accounts: BankAccount [] -count: int +Bank (String filename) -readAccounts (Stringfilename) : void +find (long number): BankAccount +add (BankAccount ba): boolean +remove

* "Interface" Comparable +compareTo (E obj): int "Interface" Closable +isclosable (): boolean has Bank -accounts: BankAccount [] -count: int +Bank (String filename) -readAccounts (String filename) : void +find (long number): BankAccount +add (BankAccount ba): boolean +remove (long number): boolean +viewAll (): void +viewClosable(): void +sort (): void +saveAccounts (String filename) : void BankAccount -number: long. -owner: String #balance: double #BankAccount (String owner, double balance) #BankAccount (long number, String owner, double balance) +getNumber () : long +getOwner (): String +getBalance (): double +deposit (double amount) : void +withdraw (double amount) :boolean +toString(): String +simpleString(): String +compareTo (BankAccount ba): int +isclosable (): boolean The class Bank does not extend BankAccount, but uses objects of type BankAccount. This type of relationship is called composition or a has relationship. The class Bank holds an array of type BankAccount and provides methods to manipulate the list of accounts stored in the bank. In addition to find/add/remove/view operations, the bank also loads/saves the list of bank accounts from/to a text file. When a Bank instance is created, the array accounts is created with a capacity of 100. The number of accounts loaded from the file to the array accounts is not always equal to 100 and therefore the data member count is used to indicate the number of accounts stored in the array.

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 Programming Questions!