Question: Fast help please java exam i have one hour Question 2 [20 points) Implement the driver class (application) as follows: a) Create a customer with

 Fast help please java exam i have one hour Question 2

Fast help please java exam i have one hour

[20 points) Implement the driver class (application) as follows: a) Create a

customer with id 3 and name Samni. Write code to add for

the customer two saving and two checking accounts. b) Write code to

display the interest for each of the saving accounts of the customer

Question 2 [20 points) Implement the driver class (application) as follows: a) Create a customer with id 3 and name Samni. Write code to add for the customer two saving and two checking accounts. b) Write code to display the interest for each of the saving accounts of the customer c) Write code to compare the two saving accounts to display a message showing whether they are equal on one of them is smaller than the other one d) Write code to display the information of all accounts, Account Customer # number: int #balance: double +Account (acNum: 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(): [1 Account +toString(): String > Comparable + compareTo (o: E): int Checking Saving #Checking (accNum:int, bal: double) +toString(): String +computeInterest(); double -rate: double -nbYears: int +Saving (accNum: int, bal: double, ra: double, nbYear: int) +tostring(): String + computeInterest(): double A. 16 pts) Write the abstract class Account as presented in the above UML. a) Write the constructor that takes as a 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(); 1 public double computeInterest() { return 0; } C. 114 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 Limplement 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. Question 2 [20 points] Implement the driver class (application) as follows: a) Create a customer with id 3 and name Sami. Write code to add for the customer two saving and two checking accounts. b) Write code to display the interest for each of the saving accounts of the customer. c) Write code to compare the two saving accounts to display a message showing whether they are equal or one of them is smaller than the other one. d) Write code to display the information of all accounts

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!