Question: Please write the JAVA CODE on computer, No handwritten code public class Client { private String firstName , lastName , address ; private long ssn
Please write the JAVA CODE on computer, No handwritten code public class Client { private String firstName, lastName, address; private long ssn; private long phoneNumber; private Account acc; public Client(String fname, String lname, String address, long ssn, long phoneNumber) { this.firstName = fname; this.lastName = lname; this.address = address; this.ssn = ssn; this.phoneNumber = phoneNumber; } public void setAddress(String address) { this.address = address; } public void setPhoneNumber(long phoneNumber) { this.phoneNumber = phoneNumber; } public void printClientInfo() { System.out.println("Client First name: " + firstName + "Last name: " + lastName + " Address: " + address); } public boolean openAccount() { acc = new Account(100, 1); return true; } }*******************************************************************************************************************
public class Account { private double balance; private int accountNo; public Account(double balance, int accountNo) { this.balance = balance; this.accountNo = accountNo; } public boolean withdraw(double amount){ if(balance >= amount) balance-= amount; else return false; return true; } public boolean deposit(double amount){ balance+= amount; return true; } public double getBalance(){ return balance; } } ******************************************************************************************************
public class Bank { public static void main(String[] args) { } }******************************************************************************************
Class Diagram:

make the following modifications:
?Modify the withdraw()method so that the balance cannot go under $100 after any withdraw transaction. ?Overwrite the toString() method in both the client and account classes. ?Write an addClient()method in the Bank class, this method should create a new client object, a new account object and link them together, then adds the client to an array of clients in the Bank Class. ?There are two possible kinds of bank accounts, either a checking account, or savings account. A savings account has an interest rate on the account balance.
?Implement a method calculateInterest() in the savings account class. ?Overwrite the deposit() method in the savings class to increment the balance with the interest. Make any necessary changes to make this work !! ?Each client can have both a checking account and savings account. Modify the code to accommodate these two types of accounts for each client. ?Complete the implementation of the Bank Driver main method to test all your functionalities.
Account Client Bank First Name Last Name Address Phone number SSN Account Balance Account No Client createClient() deposit() withdraw() getBalance()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
