Question: Java net beans Part I: Composition, Inheritance, Polymorphism, Abstract Classes and Interfaces Question 1 [40 pts] Implement the below classes and interface as presented in

![Question 1 [40 pts] Implement the below classes and interface as presented](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f463df8b5fe_38366f463df1d268.jpg)
Java net beans
Part I: Composition, Inheritance, Polymorphism, Abstract Classes and Interfaces Question 1 [40 pts] Implement the below classes and interface as presented in the following UML diagram except the class Basic Subscriber for which you will find the code provided below. For all classes implement only the getters that you will need later in your code. Account Customer # number: int # balance: double +Account (acchum: int, bal: double) +tostring(): String +computeInterest(): double -id: int -name: String -accounts: [] Account -accountsCounter: int +Customer: (id: int, name: String) +addAccount (acc: Account) : void +getAccounts(): []Account toString(): String > Comparable + compareTo (o: E): int Checking +Checking (accllum:int, bal: double) +toString(): String +computeInterest(): double Saving -rate: double -nbYear: int +Saving (accNum: int, bal: double, ta: double, nbYear: int) +toString(): String +computeInterest(): double + compareTo (0:E): int A. (6 pts] Write the abstract class Account as presented in the above UML. a) Write the constructor take as parameter the account number. b) Write the abstract method computeInterest. c) Write the toString() method returns the information about all data members. B. Do not implement the class Checking. The code is: public class Checking extends Account ( public Checking (int accNum, double bal) { super (nbAccount, bal); } public String toString() { return "Checking Account: + super.toString(); } public double computeInterest() { return 0; i } 1! 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 nb Years must be positive. b) Write the toString() method which returns the Saving account information_ c) Implement the computeInterest 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
