Question: in java plz C. (14 pts) Implement the class Saving. The data fields are rate representing the interest rate and nbyear representing the number of

in java plz in java plz C. (14 pts) Implement the class Saving. The data
fields are rate representing the interest rate and nbyear representing the number

C. (14 pts) Implement the class Saving. The data fields are rate representing the interest rate and nbyear representing the number of years. a) A constructor that initializes the rate and the year number. The rate and the nbYears must be positive. b) Write the toString() method which returns the Saving account information c) Implement the compute Interest method based on the following formula: interest = balance rate* nb of years. d) Implement the compareTo method of the "Comparable" interface. A Saving account is compared to another Saving account by comparing the rate. D. (20 pts).Implement the class Customer, Each customer has an id, a name, an array of accounts, and a counter of accounts. a) Constructor: initializes the customer information (id, name) and creates an empty array of accounts of size 10. b) addAccount(acc: Account): this method add an account to the array of customer accounts. c) getAccounts(): this method returns the array of accounts. d) Write the toString() method which returns all information of the customer. Account Customer # number: int #balance: double +Account (accNum: int, bal: double) +toString(): String +computeInterest(): double -id: int -name: String -accounts: Account -accountsCounter: int +Customer: (id: int, name: String) +addAccount (ace: Account) : void +getAccounts(): [1 Account +toString(): String

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!